diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/Az.ServiceLinker.csproj b/generated/ServiceLinker/ServiceLinker.Autorest/Az.ServiceLinker.csproj index e6c1a14713eb..c22884a0b384 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/Az.ServiceLinker.csproj +++ b/generated/ServiceLinker/ServiceLinker.Autorest/Az.ServiceLinker.csproj @@ -2,9 +2,9 @@ ServiceLinker ServiceLinker + ServiceLinker.Autorest - diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/Az.ServiceLinker.format.ps1xml b/generated/ServiceLinker/ServiceLinker.Autorest/Az.ServiceLinker.format.ps1xml index 8c1c158049e7..a2975b859fd4 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/Az.ServiceLinker.format.ps1xml +++ b/generated/ServiceLinker/ServiceLinker.Autorest/Az.ServiceLinker.format.ps1xml @@ -2,57 +2,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ServiceLinkerIdentity + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AccessKeyInfoBase - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ServiceLinkerIdentity + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AccessKeyInfoBase#Multiple - - - - - - - - - - - - - - - - - - - + - ConnectorName - - - DryrunName - - - LinkerName - - - Location - - - ResourceGroupName - - - ResourceUri - - - SubscriptionId + AuthType @@ -60,33 +24,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorDetail + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AuthInfoBase - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorDetail + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AuthInfoBase#Multiple - - - - - - - + - Code - - - Message - - - Target + AuthType @@ -94,39 +46,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.Operation + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AzureKeyVaultProperties - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.Operation + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AzureKeyVaultProperties#Multiple - - - - - - - - - - + - ActionType - - - IsDataAction - - - Name - - - Origin + ConnectAsKubernetesCsiDriver @@ -134,61 +68,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.OperationDisplay + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.BasicErrorDryrunPrerequisiteResult - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.OperationDisplay + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.BasicErrorDryrunPrerequisiteResult#Multiple - - - - - - - + - + - Description - - - Operation - - - Provider + Code - Resource - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.OperationListResult - - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.OperationListResult - - - - - - - - - - - - NextLink + Message @@ -196,57 +96,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ProxyResource + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfo - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ProxyResource + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfo#Multiple - - - - - - - - - - - - - - - - + - + - Name - - - SystemDataCreatedAt - - - SystemDataCreatedBy - - - SystemDataCreatedByType - - - SystemDataLastModifiedAt - - - SystemDataLastModifiedBy + Action - SystemDataLastModifiedByType + DeleteOrUpdateBehavior @@ -254,21 +124,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.Resource + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoAdditionalConfigurations - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.Resource + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoAdditionalConfigurations#Multiple - + - Name + Item @@ -276,51 +146,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.SystemData + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoCustomizedKeys - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.SystemData + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoCustomizedKeys#Multiple - - - - - - - - - - - - - - - - + - CreatedAt - - - CreatedBy - - - CreatedByType - - - LastModifiedAt - - - LastModifiedBy - - - LastModifiedByType + Item @@ -328,27 +168,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AccessKeyInfoBase + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationName - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AccessKeyInfoBase + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationName#Multiple - + - + - AuthType + Description - Permission + Value @@ -356,21 +196,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AuthInfoBase + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationNameResult - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AuthInfoBase + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationNameResult#Multiple - + - AuthType + NextLink @@ -378,49 +218,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AzureKeyVaultProperties + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationNames - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AzureKeyVaultProperties + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationNames#Multiple - + - - - - - - ConnectAsKubernetesCsiDriver - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.BasicErrorDryrunPrerequisiteResult - - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.BasicErrorDryrunPrerequisiteResult - - - - + - + - Code + AuthType - Message + ClientType + + + TargetService @@ -428,27 +252,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfluentBootstrapServer - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfluentBootstrapServer#Multiple - - - - + - Action - - - DeleteOrUpdateBehavior + Endpoint @@ -456,21 +274,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoAdditionalConfigurations + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfluentSchemaRegistry - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoAdditionalConfigurations + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfluentSchemaRegistry#Multiple - + - Item + Endpoint @@ -478,21 +296,99 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoCustomizedKeys + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.CreateOrUpdateDryrunParameters - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoCustomizedKeys + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.CreateOrUpdateDryrunParameters#Multiple - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - Item + ActionName + + + ClientType + + + ConfigurationInfoAction + + + ConfigurationInfoDeleteOrUpdateBehavior + + + FirewallRuleAzureService + + + FirewallRuleCallerClientIP + + + ProvisioningState + + + PublicNetworkSolutionAction + + + PublicNetworkSolutionDeleteOrUpdateBehavior + + + Scope + + + SecretStoreKeyVaultId + + + SecretStoreKeyVaultSecretName + + + VNetSolutionDeleteOrUpdateBehavior + + + VNetSolutionType @@ -500,27 +396,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationName + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DatabaseAadAuthInfo - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationName + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DatabaseAadAuthInfo#Multiple - - - - + - Description - - - Value + UserName @@ -528,9 +418,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationNameResult + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunList - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationNameResult + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunList#Multiple @@ -550,33 +440,45 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationNames + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunOperationPreview - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationNames + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunOperationPreview#Multiple - + - + - + + + + + + + - AuthType + Action - ClientType + Description - TargetService + Name + + + OperationType + + + Scope @@ -584,21 +486,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfluentBootstrapServer + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunParameters - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfluentBootstrapServer + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunParameters#Multiple - + - Endpoint + ActionName @@ -606,21 +508,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfluentSchemaRegistry + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunProperties - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfluentSchemaRegistry + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunProperties#Multiple - + - Endpoint + ProvisioningState @@ -628,105 +530,63 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.CreateOrUpdateDryrunParameters + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunResource - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.CreateOrUpdateDryrunParameters + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunResource#Multiple - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - ActionName - - - ClientType - - - ConfigurationInfoAction - - - ConfigurationInfoDeleteOrUpdateBehavior - - - FirewallRuleAzureService - - - FirewallRuleCallerClientIP - - - FirewallRuleIPRange - - - ProvisioningState + Name - PublicNetworkSolutionAction + SystemDataCreatedAt - PublicNetworkSolutionDeleteOrUpdateBehavior + SystemDataCreatedBy - Scope + SystemDataCreatedByType - SecretStoreKeyVaultId + SystemDataLastModifiedAt - SecretStoreKeyVaultSecretName + SystemDataLastModifiedBy - VNetSolutionDeleteOrUpdateBehavior + SystemDataLastModifiedByType - VNetSolutionType + ResourceGroupName @@ -734,21 +594,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DatabaseAadAuthInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorDetail - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DatabaseAadAuthInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorDetail#Multiple - + + + + + + + - UserName + Code + + + Message + + + Target @@ -756,21 +628,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunList + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.FirewallRules - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunList + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.FirewallRules#Multiple - + + + + - NextLink + AzureService + + + CallerClientIP @@ -778,45 +656,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunOperationPreview + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.KeyVaultSecretReferenceSecretInfo - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunOperationPreview + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.KeyVaultSecretReferenceSecretInfo#Multiple - - - - + - - - - + - Action - - - Description + SecretType Name - OperationType - - - Scope + Version @@ -824,21 +690,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunParameters + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.KeyVaultSecretUriSecretInfo - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunParameters + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.KeyVaultSecretUriSecretInfo#Multiple - + + + + - ActionName + SecretType + + + Value @@ -846,31 +718,43 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunProperties + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerProperties - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunProperties + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerProperties#Multiple + + + + + + + + ClientType + ProvisioningState + + Scope + - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunResource + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerResource - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunResource + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerResource#Multiple @@ -895,6 +779,9 @@ + + + @@ -920,39 +807,48 @@ SystemDataLastModifiedByType + + ResourceGroupName + - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.FirewallRules + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Operation - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.FirewallRules + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Operation#Multiple - + - + + + + - + - AzureService + ActionType - CallerClientIP + IsDataAction + + + Name - IPRange + Origin @@ -960,33 +856,39 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.KeyVaultSecretReferenceSecretInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.OperationDisplay - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.KeyVaultSecretReferenceSecretInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.OperationDisplay#Multiple - + - + - + + + + - SecretType + Description - Name + Operation - Version + Provider + + + Resource @@ -994,27 +896,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.KeyVaultSecretUriSecretInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.OperationListResult - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.KeyVaultSecretUriSecretInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.OperationListResult#Multiple - - - - + - SecretType - - - Value + NextLink @@ -1022,17 +918,14 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerProperties + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.PermissionsMissingDryrunPrerequisiteResult - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerProperties + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.PermissionsMissingDryrunPrerequisiteResult#Multiple - - - - + @@ -1042,10 +935,7 @@ - ClientType - - - ProvisioningState + RecommendedRole Scope @@ -1056,9 +946,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerResource + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ProxyResource - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerResource + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ProxyResource#Multiple @@ -1114,33 +1004,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.PermissionsMissingDryrunPrerequisiteResult + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.PublicNetworkSolution - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.PermissionsMissingDryrunPrerequisiteResult + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.PublicNetworkSolution#Multiple - - - - + - + - Permission - - - RecommendedRole + Action - Scope + DeleteOrUpdateBehavior @@ -1148,27 +1032,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.PublicNetworkSolution + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Resource - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.PublicNetworkSolution + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Resource#Multiple - - - - + - Action - - - DeleteOrUpdateBehavior + Name @@ -1176,9 +1054,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ResourceList + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ResourceList - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ResourceList + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ResourceList#Multiple @@ -1198,9 +1076,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretAuthInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretAuthInfo - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretAuthInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretAuthInfo#Multiple @@ -1226,9 +1104,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretInfoBase + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretInfoBase - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretInfoBase + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretInfoBase#Multiple @@ -1248,9 +1126,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretStore + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretStore - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretStore + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretStore#Multiple @@ -1276,9 +1154,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SelfHostedServer + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SelfHostedServer - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SelfHostedServer + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SelfHostedServer#Multiple @@ -1298,9 +1176,67 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ServicePrincipalCertificateAuthInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ServiceLinkerIdentity + + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ServiceLinkerIdentity#Multiple + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ConnectorName + + + DryrunName + + + LinkerName + + + Location + + + ResourceGroupName + + + ResourceUri + + + SubscriptionId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ServicePrincipalCertificateAuthInfo - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ServicePrincipalCertificateAuthInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ServicePrincipalCertificateAuthInfo#Multiple @@ -1319,9 +1255,6 @@ - - - @@ -1341,18 +1274,15 @@ PrincipalId - - Role - - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ServicePrincipalSecretAuthInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ServicePrincipalSecretAuthInfo - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ServicePrincipalSecretAuthInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ServicePrincipalSecretAuthInfo#Multiple @@ -1371,9 +1301,6 @@ - - - @@ -1396,9 +1323,6 @@ PrincipalId - - Role - Secret @@ -1408,9 +1332,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SourceConfiguration + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SourceConfiguration - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SourceConfiguration + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SourceConfiguration#Multiple @@ -1436,9 +1360,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SystemAssignedIdentityAuthInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SystemAssignedIdentityAuthInfo - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SystemAssignedIdentityAuthInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SystemAssignedIdentityAuthInfo#Multiple @@ -1451,9 +1375,6 @@ - - - @@ -1467,8 +1388,57 @@ DeleteOrUpdateBehavior + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SystemData + + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SystemData#Multiple + + + + + + + + + + + + + + + + + + + + + + + + + + + CreatedAt + + + CreatedBy + + + CreatedByType + + + LastModifiedAt + - Role + LastModifiedBy + + + LastModifiedByType @@ -1476,9 +1446,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.UserAccountAuthInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.UserAccountAuthInfo - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.UserAccountAuthInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.UserAccountAuthInfo#Multiple @@ -1494,9 +1464,6 @@ - - - @@ -1513,18 +1480,15 @@ PrincipalId - - Role - - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.UserAssignedIdentityAuthInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.UserAssignedIdentityAuthInfo - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.UserAssignedIdentityAuthInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.UserAssignedIdentityAuthInfo#Multiple @@ -1540,9 +1504,6 @@ - - - @@ -1562,9 +1523,6 @@ DeleteOrUpdateBehavior - - Role - SubscriptionId @@ -1574,9 +1532,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ValidateOperationResult + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ValidateOperationResult - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ValidateOperationResult + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ValidateOperationResult#Multiple @@ -1602,9 +1560,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ValidateResult + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ValidateResult - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ValidateResult + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ValidateResult#Multiple @@ -1660,9 +1618,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ValidationResultItem + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ValidationResultItem - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ValidationResultItem + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ValidationResultItem#Multiple @@ -1706,9 +1664,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ValueSecretInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ValueSecretInfo - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ValueSecretInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ValueSecretInfo#Multiple @@ -1734,9 +1692,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.VNetSolution + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.VNetSolution - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.VNetSolution + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.VNetSolution#Multiple diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/Az.ServiceLinker.psd1 b/generated/ServiceLinker/ServiceLinker.Autorest/Az.ServiceLinker.psd1 index 60269b07a55e..f7c14d87fa9c 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/Az.ServiceLinker.psd1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/Az.ServiceLinker.psd1 @@ -11,8 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.ServiceLinker.private.dll' FormatsToProcess = './Az.ServiceLinker.format.ps1xml' - FunctionsToExport = 'Get-AzServiceLinkerConfigurationForContainerApp', 'Get-AzServiceLinkerConfigurationForSpringCloud', 'Get-AzServiceLinkerConfigurationForWebApp', 'Get-AzServiceLinkerConfigurationName', 'Get-AzServiceLinkerForContainerApp', 'Get-AzServiceLinkerForSpringCloud', 'Get-AzServiceLinkerForWebApp', 'New-AzServiceLinkerAzureResourceObject', 'New-AzServiceLinkerConfluentBootstrapServerObject', 'New-AzServiceLinkerConfluentSchemaRegistryObject', 'New-AzServiceLinkerForContainerApp', 'New-AzServiceLinkerForSpringCloud', 'New-AzServiceLinkerForWebApp', 'New-AzServiceLinkerSecretAuthInfoObject', 'New-AzServiceLinkerServicePrincipalSecretAuthInfoObject', 'New-AzServiceLinkerSystemAssignedIdentityAuthInfoObject', 'New-AzServiceLinkerUserAssignedIdentityAuthInfoObject', 'Remove-AzServiceLinkerForContainerApp', 'Remove-AzServiceLinkerForSpringCloud', 'Remove-AzServiceLinkerForWebApp', 'Test-AzServiceLinkerForContainerApp', 'Test-AzServiceLinkerForSpringCloud', 'Test-AzServiceLinkerForWebApp', 'Update-AzServiceLinkerForContainerApp', 'Update-AzServiceLinkerForSpringCloud', 'Update-AzServiceLinkerForWebApp', '*' - AliasesToExport = '*' + FunctionsToExport = 'Get-AzServiceLinkerConfigurationForContainerApp', 'Get-AzServiceLinkerConfigurationForSpringCloud', 'Get-AzServiceLinkerConfigurationForWebApp', 'Get-AzServiceLinkerConfigurationName', 'Get-AzServiceLinkerForContainerApp', 'Get-AzServiceLinkerForSpringCloud', 'Get-AzServiceLinkerForWebApp', 'New-AzServiceLinkerAzureResourceObject', 'New-AzServiceLinkerConfluentBootstrapServerObject', 'New-AzServiceLinkerConfluentSchemaRegistryObject', 'New-AzServiceLinkerForContainerApp', 'New-AzServiceLinkerForSpringCloud', 'New-AzServiceLinkerForWebApp', 'New-AzServiceLinkerSecretAuthInfoObject', 'New-AzServiceLinkerServicePrincipalSecretAuthInfoObject', 'New-AzServiceLinkerSystemAssignedIdentityAuthInfoObject', 'New-AzServiceLinkerUserAssignedIdentityAuthInfoObject', 'Remove-AzServiceLinkerForContainerApp', 'Remove-AzServiceLinkerForSpringCloud', 'Remove-AzServiceLinkerForWebApp', 'Test-AzServiceLinkerForContainerApp', 'Test-AzServiceLinkerForSpringCloud', 'Test-AzServiceLinkerForWebApp', 'Update-AzServiceLinkerForContainerApp', 'Update-AzServiceLinkerForSpringCloud', 'Update-AzServiceLinkerForWebApp' PrivateData = @{ PSData = @{ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'ServiceLinker' diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/Properties/AssemblyInfo.cs b/generated/ServiceLinker/ServiceLinker.Autorest/Properties/AssemblyInfo.cs index 0ea153fffa7e..c85b54fac4b5 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/Properties/AssemblyInfo.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/Properties/AssemblyInfo.cs @@ -1,28 +1,29 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// Licensed under the Apache License, Version 2.0 (the "License"); +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the Apache License, Version 2.0 (the ""License""); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, +// distributed under the License is distributed on an ""AS IS"" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// ---------------------------------------------------------------------------------- +// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +// is regenerated. using System; using System.Reflection; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyTitle("Microsoft Azure Powershell - ServiceLinker")] -[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)] -[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)] -[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)] +[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")] +[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")] +[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")] +[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - ServiceLinker")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("0.2.3")] +[assembly: System.Reflection.AssemblyVersionAttribute("0.2.3")] +[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] +[assembly: System.CLSCompliantAttribute(false)] + + -[assembly: ComVisible(false)] -[assembly: CLSCompliant(false)] -[assembly: Guid("e290afad-f8a0-4683-8688-2522dcadc660")] -[assembly: AssemblyVersion("0.2.3")] -[assembly: AssemblyFileVersion("0.2.3")] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/check-dependencies.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/check-dependencies.ps1 index c29591c7bfe1..90ca9867ae40 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/check-dependencies.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/check-dependencies.ps1 @@ -12,13 +12,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code # is regenerated. # ---------------------------------------------------------------------------------- -param([switch]$Isolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources) +param([switch]$NotIsolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources) $ErrorActionPreference = 'Stop' -if(-not $Isolated) { +if(-not $NotIsolated) { Write-Host -ForegroundColor Green 'Creating isolated process...' $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path - & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated return } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerConfigurationForContainerApp.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerConfigurationForContainerApp.ps1 index c5c9f89bc797..5ce7561edfae 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerConfigurationForContainerApp.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerConfigurationForContainerApp.ps1 @@ -23,12 +23,12 @@ list source configurations for a linker in container app. Get-AzServiceLinkerConfigurationForContainerApp -ContainerApp servicelinker-containerapp -ResourceGroupName servicelinker-test-group -LinkerName postgresql_linker | Format-List .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfiguration .Link https://learn.microsoft.com/powershell/module/az.servicelinker/get-azservicelinkerconfigurationforcontainerapp #> function Get-AzServiceLinkerConfigurationForContainerApp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfiguration])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -118,6 +118,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -139,9 +148,7 @@ begin { $mapping = @{ List = 'Az.ServiceLinker.custom\Get-AzServiceLinkerConfigurationForContainerApp'; } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -155,6 +162,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerConfigurationForSpringCloud.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerConfigurationForSpringCloud.ps1 index 40f63e4e7d65..e32566e6092f 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerConfigurationForSpringCloud.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerConfigurationForSpringCloud.ps1 @@ -23,12 +23,12 @@ list source configurations for a linker in spring cloud. Get-AzServiceLinkerConfigurationForSpringCloud -ServiceName servicelinker-springcloud -AppName appconfiguration -ResourceGroupName servicelinker-test-group -LinkerName postgresql_linker | Format-List .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfiguration .Link https://learn.microsoft.com/powershell/module/az.servicelinker/get-azservicelinkerconfigurationforspringcloud #> function Get-AzServiceLinkerConfigurationForSpringCloud { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfiguration])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -131,6 +131,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -152,12 +161,10 @@ begin { $mapping = @{ List = 'Az.ServiceLinker.custom\Get-AzServiceLinkerConfigurationForSpringCloud'; } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('DeploymentName')) { + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('DeploymentName') ) { $PSBoundParameters['DeploymentName'] = "default" } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -171,6 +178,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerConfigurationForWebApp.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerConfigurationForWebApp.ps1 index ba87ac0091f1..454d35933e2c 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerConfigurationForWebApp.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerConfigurationForWebApp.ps1 @@ -23,12 +23,12 @@ list source configurations for a linker in webapp. Get-AzServiceLinkerConfigurationForWebApp -WebApp servicelinker-webapp -ResourceGroupName servicelinker-test-group -LinkerName postgresql_linker | Format-List .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfiguration .Link https://learn.microsoft.com/powershell/module/az.servicelinker/get-azservicelinkerconfigurationforwebapp #> function Get-AzServiceLinkerConfigurationForWebApp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfiguration])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -118,6 +118,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -139,9 +148,7 @@ begin { $mapping = @{ List = 'Az.ServiceLinker.custom\Get-AzServiceLinkerConfigurationForWebApp'; } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -155,6 +162,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerConfigurationName.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerConfigurationName.ps1 index 3991db793639..8bf1d01f2532 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerConfigurationName.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerConfigurationName.ps1 @@ -23,12 +23,12 @@ Lists the configuration names generated by Service Connector for all target, cli Get-AzServiceLinkerConfigurationName .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItem +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItem .Link https://learn.microsoft.com/powershell/module/az.servicelinker/get-azservicelinkerconfigurationname #> function Get-AzServiceLinkerConfigurationName { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItem])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItem])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -99,6 +99,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -127,6 +136,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerForContainerApp.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerForContainerApp.ps1 index ab2bf7943138..1b6010065faa 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerForContainerApp.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerForContainerApp.ps1 @@ -33,13 +33,13 @@ $identity | Get-AzServiceLinkerForContainerApp | Format-List .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ConnectorName ]: The name of resource. [DryrunName ]: The name of dryrun. [Id ]: Resource identity path @@ -52,7 +52,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.servicelinker/get-azservicelinkerforcontainerapp #> function Get-AzServiceLinkerForContainerApp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='List')] @@ -153,6 +153,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -176,9 +185,7 @@ begin { Get = 'Az.ServiceLinker.custom\Get-AzServiceLinkerForContainerApp'; GetViaIdentity = 'Az.ServiceLinker.custom\Get-AzServiceLinkerForContainerApp'; } - if (('List', 'Get', 'GetViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List', 'Get', 'GetViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -192,6 +199,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerForSpringCloud.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerForSpringCloud.ps1 index bd42fb14ba4b..9f24b05bb8f7 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerForSpringCloud.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerForSpringCloud.ps1 @@ -33,13 +33,13 @@ $identity | Get-AzServiceLinkerForSpringCloud | Format-List .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ConnectorName ]: The name of resource. [DryrunName ]: The name of dryrun. [Id ]: Resource identity path @@ -52,7 +52,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.servicelinker/get-azservicelinkerforspringcloud #> function Get-AzServiceLinkerForSpringCloud { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='List')] @@ -168,6 +168,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -191,12 +200,10 @@ begin { Get = 'Az.ServiceLinker.custom\Get-AzServiceLinkerForSpringCloud'; GetViaIdentity = 'Az.ServiceLinker.custom\Get-AzServiceLinkerForSpringCloud'; } - if (('List', 'Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('DeploymentName')) { + if (('List', 'Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('DeploymentName') ) { $PSBoundParameters['DeploymentName'] = "default" } - if (('List', 'Get', 'GetViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List', 'Get', 'GetViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -210,6 +217,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerForWebApp.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerForWebApp.ps1 index 4c0ab8ff2fb7..e41214834428 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerForWebApp.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Get-AzServiceLinkerForWebApp.ps1 @@ -33,13 +33,13 @@ $identity | Get-AzServiceLinkerForWebApp | Format-List .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ConnectorName ]: The name of resource. [DryrunName ]: The name of dryrun. [Id ]: Resource identity path @@ -52,7 +52,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.servicelinker/get-azservicelinkerforwebapp #> function Get-AzServiceLinkerForWebApp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='List')] @@ -153,6 +153,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -176,9 +185,7 @@ begin { Get = 'Az.ServiceLinker.custom\Get-AzServiceLinkerForWebApp'; GetViaIdentity = 'Az.ServiceLinker.custom\Get-AzServiceLinkerForWebApp'; } - if (('List', 'Get', 'GetViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List', 'Get', 'GetViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -192,6 +199,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerAzureResourceObject.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerAzureResourceObject.ps1 index 35142a28da03..5c64938b3fec 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerAzureResourceObject.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerAzureResourceObject.ps1 @@ -23,12 +23,12 @@ Create an in-memory object for AzureResource. New-AzServiceLinkerAzureResourceObject -Id /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/servicelinker-test-group/providers/Microsoft.KeyVault/vaults/servicelinker-test-kv -ConnectAsKubernetesCsiDriver 1 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AzureResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AzureResource .Link https://learn.microsoft.com/powershell/module/az.ServiceLinker/new-azservicelinkerazureresourceobject #> function New-AzServiceLinkerAzureResourceObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AzureResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AzureResource])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -45,10 +45,9 @@ param( ${ConnectAsKubernetesCsiDriver}, [Parameter(DontShow)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType])] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo(Script='"AzureResource"')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType] + [System.String] # The target service type. ${Type} ) @@ -60,6 +59,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -81,7 +83,7 @@ begin { $mapping = @{ __AllParameterSets = 'Az.ServiceLinker.custom\New-AzServiceLinkerAzureResourceObject'; } - if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Type')) { + if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Type') ) { $PSBoundParameters['Type'] = "AzureResource" } $cmdInfo = Get-Command -Name $mapping[$parameterSet] @@ -91,6 +93,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerConfluentBootstrapServerObject.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerConfluentBootstrapServerObject.ps1 index 31ac17fed258..f3b82bade698 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerConfluentBootstrapServerObject.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerConfluentBootstrapServerObject.ps1 @@ -23,27 +23,19 @@ Create an in-memory object for ConfluentBootstrapServer. New-AzServiceLinkerConfluentBootstrapServerObject -Endpoint "pkc-xxxx.eastus.azure.confluent.cloud:9092" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfluentBootstrapServer +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfluentBootstrapServer .Link https://learn.microsoft.com/powershell/module/az.ServiceLinker/new-azservicelinkerconfluentbootstrapserverobject #> function New-AzServiceLinkerConfluentBootstrapServerObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfluentBootstrapServer])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfluentBootstrapServer])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] [System.String] # The endpoint of service. - ${Endpoint}, - - [Parameter(DontShow)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType])] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo(Script='"ConfluentBootstrapServer"')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType] - # The target service type. - ${Type} + ${Endpoint} ) begin { @@ -53,6 +45,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -74,9 +69,6 @@ begin { $mapping = @{ __AllParameterSets = 'Az.ServiceLinker.custom\New-AzServiceLinkerConfluentBootstrapServerObject'; } - if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Type')) { - $PSBoundParameters['Type'] = "ConfluentBootstrapServer" - } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ @@ -84,6 +76,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerConfluentSchemaRegistryObject.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerConfluentSchemaRegistryObject.ps1 index 23cdfe4b3ed6..9b1f93161ac9 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerConfluentSchemaRegistryObject.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerConfluentSchemaRegistryObject.ps1 @@ -23,27 +23,19 @@ Create an in-memory object for ConfluentSchemaRegistry. New-AzServiceLinkerConfluentSchemaRegistryObject -Endpoint "https://psrc-xxxx.westus2.azure.confluent.cloud" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfluentSchemaRegistry +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfluentSchemaRegistry .Link https://learn.microsoft.com/powershell/module/az.ServiceLinker/new-azservicelinkerconfluentschemaregistryobject #> function New-AzServiceLinkerConfluentSchemaRegistryObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfluentSchemaRegistry])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfluentSchemaRegistry])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] [System.String] # The endpoint of service. - ${Endpoint}, - - [Parameter(DontShow)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType])] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo(Script='"ConfluentSchemaRegistry"')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType] - # The target service type. - ${Type} + ${Endpoint} ) begin { @@ -53,6 +45,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -74,9 +69,6 @@ begin { $mapping = @{ __AllParameterSets = 'Az.ServiceLinker.custom\New-AzServiceLinkerConfluentSchemaRegistryObject'; } - if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Type')) { - $PSBoundParameters['Type'] = "ConfluentSchemaRegistry" - } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ @@ -84,6 +76,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerForContainerApp.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerForContainerApp.ps1 index 30e8927f3fc8..9ef2e49ef275 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerForContainerApp.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerForContainerApp.ps1 @@ -27,22 +27,22 @@ $authInfo=New-AzServiceLinkerSecretAuthInfoObject -Name testUser -SecretValue ** New-AzServiceLinkerForContainerApp -TargetService $target -AuthInfo $auth -ClientType dotnet -LinkerName testLinker -ContainerApp servicelinker-app -ResourceGroupName servicelinker-test-linux-group -Scope 'simple-hello-world-container' .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource .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. -AUTHINFO : The authentication type. - AuthType : The authentication type. +AUTHINFO : The authentication type. To construct, see NOTES section for AUTHINFO properties and create a hash table. + AuthType : The authentication type. -TARGETSERVICE : The target service properties - Type : The target service type. +TARGETSERVICE : The target service properties To construct, see NOTES section for TARGETSERVICE properties and create a hash table. + Type : The target service type. .Link https://learn.microsoft.com/powershell/module/az.servicelinker/new-azservicelinkerforcontainerapp #> function New-AzServiceLinkerForContainerApp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter()] @@ -67,30 +67,30 @@ param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase] # The authentication type. # To construct, see NOTES section for AUTHINFO properties and create a hash table. ${AuthInfo}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase] # The target service properties # To construct, see NOTES section for TARGETSERVICE properties and create a hash table. ${TargetService}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo(Script='"none"')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType] + [System.String] # The application client type ${ClientType}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType] + [System.String] # Optional, indicate whether to apply configurations on source application. # If enable, generate configurations and applied to the source application. # Default is enable. @@ -99,7 +99,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations]))] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations]))] [System.Collections.Hashtable] # A dictionary of additional configurations to be added. # Service will auto generate a set of basic configurations and this property is to full fill more customized configurations @@ -107,7 +107,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys]))] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys]))] [System.Collections.Hashtable] # Optional. # A dictionary of default key name and customized key name mapping. @@ -115,16 +115,16 @@ param( ${ConfigurationInfoCustomizedKey}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType] + [System.String] # Allow Azure services to access the target service if true. ${FirewallRuleAzureService}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType] + [System.String] # Allow caller client IP to access the target service if true. # the property is used when connecting local application to target service. ${FirewallRuleCallerClientIP}, @@ -137,9 +137,9 @@ param( ${FirewallRuleIPRange}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType] + [System.String] # Optional. # Indicates public network solution. # If enable, enable public network access of target service with best try. @@ -166,9 +166,9 @@ param( ${SecretStoreKeyVaultSecretName}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType] + [System.String] # Type of VNet solution. ${VNetSolutionType}, @@ -260,6 +260,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -281,15 +290,13 @@ begin { $mapping = @{ CreateExpanded = 'Az.ServiceLinker.custom\New-AzServiceLinkerForContainerApp'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Name')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Name') ) { $PSBoundParameters['Name'] = "connect_"+(-join ((65..90) + (97..122) | Get-Random -Count 5 | % {[char]$_})) } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('ClientType')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('ClientType') ) { $PSBoundParameters['ClientType'] = "none" } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -303,6 +310,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerForSpringCloud.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerForSpringCloud.ps1 index 0a39bc04bec4..4e93721c1bfd 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerForSpringCloud.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerForSpringCloud.ps1 @@ -29,22 +29,22 @@ New-AzServiceLinkerForSpringCloud -TargetService $target -AuthInfo $auth -Client .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource .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. -AUTHINFO : The authentication type. - AuthType : The authentication type. +AUTHINFO : The authentication type. To construct, see NOTES section for AUTHINFO properties and create a hash table. + AuthType : The authentication type. -TARGETSERVICE : The target service properties - Type : The target service type. +TARGETSERVICE : The target service properties To construct, see NOTES section for TARGETSERVICE properties and create a hash table. + Type : The target service type. .Link https://learn.microsoft.com/powershell/module/az.servicelinker/new-azservicelinkerforspringcloud #> function New-AzServiceLinkerForSpringCloud { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter()] @@ -69,30 +69,30 @@ param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase] # The authentication type. # To construct, see NOTES section for AUTHINFO properties and create a hash table. ${AuthInfo}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase] # The target service properties # To construct, see NOTES section for TARGETSERVICE properties and create a hash table. ${TargetService}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo(Script='"none"')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType] + [System.String] # The application client type ${ClientType}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType] + [System.String] # Optional, indicate whether to apply configurations on source application. # If enable, generate configurations and applied to the source application. # Default is enable. @@ -101,7 +101,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations]))] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations]))] [System.Collections.Hashtable] # A dictionary of additional configurations to be added. # Service will auto generate a set of basic configurations and this property is to full fill more customized configurations @@ -109,7 +109,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys]))] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys]))] [System.Collections.Hashtable] # Optional. # A dictionary of default key name and customized key name mapping. @@ -117,16 +117,16 @@ param( ${ConfigurationInfoCustomizedKey}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType] + [System.String] # Allow Azure services to access the target service if true. ${FirewallRuleAzureService}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType] + [System.String] # Allow caller client IP to access the target service if true. # the property is used when connecting local application to target service. ${FirewallRuleCallerClientIP}, @@ -139,9 +139,9 @@ param( ${FirewallRuleIPRange}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType] + [System.String] # Optional. # Indicates public network solution. # If enable, enable public network access of target service with best try. @@ -168,9 +168,9 @@ param( ${SecretStoreKeyVaultSecretName}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType] + [System.String] # Type of VNet solution. ${VNetSolutionType}, @@ -275,6 +275,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -296,18 +305,16 @@ begin { $mapping = @{ CreateExpanded = 'Az.ServiceLinker.custom\New-AzServiceLinkerForSpringCloud'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Name')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Name') ) { $PSBoundParameters['Name'] = "connect_"+(-join ((65..90) + (97..122) | Get-Random -Count 5 | % {[char]$_})) } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('ClientType')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('ClientType') ) { $PSBoundParameters['ClientType'] = "none" } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('DeploymentName')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('DeploymentName') ) { $PSBoundParameters['DeploymentName'] = "default" } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -321,6 +328,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerForWebApp.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerForWebApp.ps1 index 74200a31b18a..7ad4beb11b02 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerForWebApp.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerForWebApp.ps1 @@ -27,22 +27,22 @@ $authInfo=New-AzServiceLinkerSecretAuthInfoObject -Name testUser -SecretValue ** New-AzServiceLinkerForWebApp -TargetService $target -AuthInfo $auth -ClientType dotnet -LinkerName testLinker -WebApp servicelinker-app -ResourceGroupName servicelinker-test-group .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource .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. -AUTHINFO : The authentication type. - AuthType : The authentication type. +AUTHINFO : The authentication type. To construct, see NOTES section for AUTHINFO properties and create a hash table. + AuthType : The authentication type. -TARGETSERVICE : The target service properties - Type : The target service type. +TARGETSERVICE : The target service properties To construct, see NOTES section for TARGETSERVICE properties and create a hash table. + Type : The target service type. .Link https://learn.microsoft.com/powershell/module/az.servicelinker/new-azservicelinkerforwebapp #> function New-AzServiceLinkerForWebApp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter()] @@ -67,30 +67,30 @@ param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase] # The authentication type. # To construct, see NOTES section for AUTHINFO properties and create a hash table. ${AuthInfo}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase] # The target service properties # To construct, see NOTES section for TARGETSERVICE properties and create a hash table. ${TargetService}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo(Script='"none"')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType] + [System.String] # The application client type ${ClientType}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType] + [System.String] # Optional, indicate whether to apply configurations on source application. # If enable, generate configurations and applied to the source application. # Default is enable. @@ -99,7 +99,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations]))] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations]))] [System.Collections.Hashtable] # A dictionary of additional configurations to be added. # Service will auto generate a set of basic configurations and this property is to full fill more customized configurations @@ -107,7 +107,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys]))] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys]))] [System.Collections.Hashtable] # Optional. # A dictionary of default key name and customized key name mapping. @@ -115,16 +115,16 @@ param( ${ConfigurationInfoCustomizedKey}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType] + [System.String] # Allow Azure services to access the target service if true. ${FirewallRuleAzureService}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType] + [System.String] # Allow caller client IP to access the target service if true. # the property is used when connecting local application to target service. ${FirewallRuleCallerClientIP}, @@ -137,9 +137,9 @@ param( ${FirewallRuleIPRange}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType] + [System.String] # Optional. # Indicates public network solution. # If enable, enable public network access of target service with best try. @@ -166,9 +166,9 @@ param( ${SecretStoreKeyVaultSecretName}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType] + [System.String] # Type of VNet solution. ${VNetSolutionType}, @@ -261,6 +261,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -282,15 +291,13 @@ begin { $mapping = @{ CreateExpanded = 'Az.ServiceLinker.custom\New-AzServiceLinkerForWebApp'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Name')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Name') ) { $PSBoundParameters['Name'] = "connect_"+(-join ((65..90) + (97..122) | Get-Random -Count 5 | % {[char]$_})) } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('ClientType')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('ClientType') ) { $PSBoundParameters['ClientType'] = "none" } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -304,6 +311,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerSecretAuthInfoObject.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerSecretAuthInfoObject.ps1 index b0dcf214c14c..34b2bb0199a9 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerSecretAuthInfoObject.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerSecretAuthInfoObject.ps1 @@ -27,12 +27,12 @@ New-AzServiceLinkerSecretAuthInfoObject -Name user -SecretKeyVaultUri "https://s New-AzServiceLinkerSecretAuthInfoObject -Name user -SecretNameInKeyVault test-secret .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretAuthInfo +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretAuthInfo .Link https://learn.microsoft.com/powershell/module/az.ServiceLinker/new-azservicelinkersecretauthinfoobject #> function New-AzServiceLinkerSecretAuthInfoObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretAuthInfo])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretAuthInfo])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] @@ -43,9 +43,8 @@ param( [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBase] # Password or key vault secret for secret auth. - # To construct, see NOTES section for SECRETINFO properties and create a hash table. ${SecretInfo}, [Parameter()] @@ -64,15 +63,7 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] [System.String] # The name of secret in keyvault refenced by -SecretStoreKeyVaultId. - ${SecretNameInKeyVault}, - - [Parameter(DontShow)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType])] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo(Script='"secret"')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType] - # The authentication type. - ${AuthType} + ${SecretNameInKeyVault} ) begin { @@ -82,6 +73,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -103,9 +97,6 @@ begin { $mapping = @{ __AllParameterSets = 'Az.ServiceLinker.custom\New-AzServiceLinkerSecretAuthInfoObject'; } - if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('AuthType')) { - $PSBoundParameters['AuthType'] = "secret" - } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ @@ -113,6 +104,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerServicePrincipalSecretAuthInfoObject.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerServicePrincipalSecretAuthInfoObject.ps1 index 8487031d4540..afd89d9c840c 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerServicePrincipalSecretAuthInfoObject.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerServicePrincipalSecretAuthInfoObject.ps1 @@ -23,12 +23,12 @@ Create an in-memory object for ServicePrincipalSecretAuthInfo. New-AzServiceLinkerServicePrincipalSecretAuthInfoObject -ClientId 00000000-0000-0000-0000-000000000000 -PrincipalId 00000000-0000-0000-0000-000000000000 -Secret secret .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ServicePrincipalSecretAuthInfo +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ServicePrincipalSecretAuthInfo .Link https://learn.microsoft.com/powershell/module/az.ServiceLinker/new-azservicelinkerserviceprincipalsecretauthinfoobject #> function New-AzServiceLinkerServicePrincipalSecretAuthInfoObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ServicePrincipalSecretAuthInfo])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ServicePrincipalSecretAuthInfo])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -49,13 +49,18 @@ param( # Secret for servicePrincipal auth. ${Secret}, - [Parameter(DontShow)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType])] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo(Script='"servicePrincipalSecret"')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType] - # The authentication type. - ${AuthType} + [System.String[]] + # Optional, this value specifies the Azure roles to be assigned. + # Automatically . + ${Role}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] + [System.String] + # Username created in the database which is mapped to a user in AAD. + ${UserName} ) begin { @@ -65,6 +70,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -86,9 +94,6 @@ begin { $mapping = @{ __AllParameterSets = 'Az.ServiceLinker.custom\New-AzServiceLinkerServicePrincipalSecretAuthInfoObject'; } - if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('AuthType')) { - $PSBoundParameters['AuthType'] = "servicePrincipalSecret" - } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ @@ -96,6 +101,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerSystemAssignedIdentityAuthInfoObject.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerSystemAssignedIdentityAuthInfoObject.ps1 index 4db512556d5a..79561ad27e6c 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerSystemAssignedIdentityAuthInfoObject.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerSystemAssignedIdentityAuthInfoObject.ps1 @@ -23,21 +23,25 @@ Create an in-memory object for SystemAssignedIdentityAuthInfo. New-AzServiceLinkerSystemAssignedIdentityAuthInfoObject .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SystemAssignedIdentityAuthInfo +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SystemAssignedIdentityAuthInfo .Link https://learn.microsoft.com/powershell/module/az.ServiceLinker/new-azservicelinkersystemassignedidentityauthinfoobject #> function New-AzServiceLinkerSystemAssignedIdentityAuthInfoObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SystemAssignedIdentityAuthInfo])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SystemAssignedIdentityAuthInfo])] [CmdletBinding(PositionalBinding=$false)] param( - [Parameter(DontShow)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType])] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo(Script='"systemAssignedIdentity"')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType] - # The authentication type. - ${AuthType} + [System.String[]] + # Optional, this value specifies the Azure role to be assigned. + ${Role}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] + [System.String] + # Username created in the database which is mapped to a user in AAD. + ${UserName} ) begin { @@ -47,6 +51,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -68,9 +75,6 @@ begin { $mapping = @{ __AllParameterSets = 'Az.ServiceLinker.custom\New-AzServiceLinkerSystemAssignedIdentityAuthInfoObject'; } - if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('AuthType')) { - $PSBoundParameters['AuthType'] = "systemAssignedIdentity" - } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ @@ -78,6 +82,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerUserAssignedIdentityAuthInfoObject.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerUserAssignedIdentityAuthInfoObject.ps1 index b8063d894d91..04557e855422 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerUserAssignedIdentityAuthInfoObject.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/New-AzServiceLinkerUserAssignedIdentityAuthInfoObject.ps1 @@ -23,12 +23,12 @@ Create an in-memory object for UserAssignedIdentityAuthInfo. New-AzServiceLinkerUserAssignedIdentityAuthInfoObject -ClientId 00000000-0000-0000-0000-000000000000 -SubscriptionId 00000000-0000-0000-0000-000000000000 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.UserAssignedIdentityAuthInfo +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.UserAssignedIdentityAuthInfo .Link https://learn.microsoft.com/powershell/module/az.ServiceLinker/new-azservicelinkeruserassignedidentityauthinfoobject #> function New-AzServiceLinkerUserAssignedIdentityAuthInfoObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.UserAssignedIdentityAuthInfo])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.UserAssignedIdentityAuthInfo])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] @@ -37,19 +37,23 @@ param( # Client Id for userAssignedIdentity. ${ClientId}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] + [System.String[]] + # Optional, this value specifies the Azure role to be assigned. + ${Role}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] [System.String] # Subscription id for userAssignedIdentity. ${SubscriptionId}, - [Parameter(DontShow)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType])] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo(Script='"userAssignedIdentity"')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType] - # The authentication type. - ${AuthType} + [System.String] + # Username created in the database which is mapped to a user in AAD. + ${UserName} ) begin { @@ -59,6 +63,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -80,9 +87,6 @@ begin { $mapping = @{ __AllParameterSets = 'Az.ServiceLinker.custom\New-AzServiceLinkerUserAssignedIdentityAuthInfoObject'; } - if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('AuthType')) { - $PSBoundParameters['AuthType'] = "userAssignedIdentity" - } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ @@ -90,6 +94,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/ProxyCmdletDefinitions.ps1 index d464de7d3663..0368a5f2c26f 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -23,12 +23,12 @@ Lists the configuration names generated by Service Connector for all target, cli Get-AzServiceLinkerConfigurationName .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItem +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItem .Link https://learn.microsoft.com/powershell/module/az.servicelinker/get-azservicelinkerconfigurationname #> function Get-AzServiceLinkerConfigurationName { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItem])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItem])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -99,6 +99,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -127,6 +136,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -179,12 +191,12 @@ list source configurations for a linker in container app. Get-AzServiceLinkerConfigurationForContainerApp -ContainerApp servicelinker-containerapp -ResourceGroupName servicelinker-test-group -LinkerName postgresql_linker | Format-List .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfiguration .Link https://learn.microsoft.com/powershell/module/az.servicelinker/get-azservicelinkerconfigurationforcontainerapp #> function Get-AzServiceLinkerConfigurationForContainerApp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfiguration])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -274,6 +286,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -295,9 +316,7 @@ begin { $mapping = @{ List = 'Az.ServiceLinker.custom\Get-AzServiceLinkerConfigurationForContainerApp'; } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -311,6 +330,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -363,12 +385,12 @@ list source configurations for a linker in spring cloud. Get-AzServiceLinkerConfigurationForSpringCloud -ServiceName servicelinker-springcloud -AppName appconfiguration -ResourceGroupName servicelinker-test-group -LinkerName postgresql_linker | Format-List .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfiguration .Link https://learn.microsoft.com/powershell/module/az.servicelinker/get-azservicelinkerconfigurationforspringcloud #> function Get-AzServiceLinkerConfigurationForSpringCloud { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfiguration])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -471,6 +493,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -492,12 +523,10 @@ begin { $mapping = @{ List = 'Az.ServiceLinker.custom\Get-AzServiceLinkerConfigurationForSpringCloud'; } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('DeploymentName')) { + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('DeploymentName') ) { $PSBoundParameters['DeploymentName'] = "default" } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -511,6 +540,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -563,12 +595,12 @@ list source configurations for a linker in webapp. Get-AzServiceLinkerConfigurationForWebApp -WebApp servicelinker-webapp -ResourceGroupName servicelinker-test-group -LinkerName postgresql_linker | Format-List .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfiguration .Link https://learn.microsoft.com/powershell/module/az.servicelinker/get-azservicelinkerconfigurationforwebapp #> function Get-AzServiceLinkerConfigurationForWebApp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfiguration])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -658,6 +690,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -679,9 +720,7 @@ begin { $mapping = @{ List = 'Az.ServiceLinker.custom\Get-AzServiceLinkerConfigurationForWebApp'; } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -695,6 +734,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -757,13 +799,13 @@ $identity | Get-AzServiceLinkerForContainerApp | Format-List .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ConnectorName ]: The name of resource. [DryrunName ]: The name of dryrun. [Id ]: Resource identity path @@ -776,7 +818,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.servicelinker/get-azservicelinkerforcontainerapp #> function Get-AzServiceLinkerForContainerApp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='List')] @@ -877,6 +919,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -900,9 +951,7 @@ begin { Get = 'Az.ServiceLinker.custom\Get-AzServiceLinkerForContainerApp'; GetViaIdentity = 'Az.ServiceLinker.custom\Get-AzServiceLinkerForContainerApp'; } - if (('List', 'Get', 'GetViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List', 'Get', 'GetViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -916,6 +965,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -978,13 +1030,13 @@ $identity | Get-AzServiceLinkerForSpringCloud | Format-List .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ConnectorName ]: The name of resource. [DryrunName ]: The name of dryrun. [Id ]: Resource identity path @@ -997,7 +1049,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.servicelinker/get-azservicelinkerforspringcloud #> function Get-AzServiceLinkerForSpringCloud { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='List')] @@ -1113,6 +1165,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1136,12 +1197,10 @@ begin { Get = 'Az.ServiceLinker.custom\Get-AzServiceLinkerForSpringCloud'; GetViaIdentity = 'Az.ServiceLinker.custom\Get-AzServiceLinkerForSpringCloud'; } - if (('List', 'Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('DeploymentName')) { + if (('List', 'Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('DeploymentName') ) { $PSBoundParameters['DeploymentName'] = "default" } - if (('List', 'Get', 'GetViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List', 'Get', 'GetViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1155,6 +1214,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1217,13 +1279,13 @@ $identity | Get-AzServiceLinkerForWebApp | Format-List .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ConnectorName ]: The name of resource. [DryrunName ]: The name of dryrun. [Id ]: Resource identity path @@ -1236,7 +1298,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.servicelinker/get-azservicelinkerforwebapp #> function Get-AzServiceLinkerForWebApp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='List')] @@ -1337,6 +1399,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1360,9 +1431,7 @@ begin { Get = 'Az.ServiceLinker.custom\Get-AzServiceLinkerForWebApp'; GetViaIdentity = 'Az.ServiceLinker.custom\Get-AzServiceLinkerForWebApp'; } - if (('List', 'Get', 'GetViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List', 'Get', 'GetViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1376,6 +1445,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1428,12 +1500,12 @@ Create an in-memory object for AzureResource. New-AzServiceLinkerAzureResourceObject -Id /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/servicelinker-test-group/providers/Microsoft.KeyVault/vaults/servicelinker-test-kv -ConnectAsKubernetesCsiDriver 1 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AzureResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AzureResource .Link https://learn.microsoft.com/powershell/module/az.ServiceLinker/new-azservicelinkerazureresourceobject #> function New-AzServiceLinkerAzureResourceObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AzureResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AzureResource])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -1450,10 +1522,9 @@ param( ${ConnectAsKubernetesCsiDriver}, [Parameter(DontShow)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType])] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo(Script='"AzureResource"')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType] + [System.String] # The target service type. ${Type} ) @@ -1465,6 +1536,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1486,7 +1560,7 @@ begin { $mapping = @{ __AllParameterSets = 'Az.ServiceLinker.custom\New-AzServiceLinkerAzureResourceObject'; } - if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Type')) { + if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Type') ) { $PSBoundParameters['Type'] = "AzureResource" } $cmdInfo = Get-Command -Name $mapping[$parameterSet] @@ -1496,6 +1570,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1548,27 +1625,19 @@ Create an in-memory object for ConfluentBootstrapServer. New-AzServiceLinkerConfluentBootstrapServerObject -Endpoint "pkc-xxxx.eastus.azure.confluent.cloud:9092" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfluentBootstrapServer +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfluentBootstrapServer .Link https://learn.microsoft.com/powershell/module/az.ServiceLinker/new-azservicelinkerconfluentbootstrapserverobject #> function New-AzServiceLinkerConfluentBootstrapServerObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfluentBootstrapServer])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfluentBootstrapServer])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] [System.String] # The endpoint of service. - ${Endpoint}, - - [Parameter(DontShow)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType])] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo(Script='"ConfluentBootstrapServer"')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType] - # The target service type. - ${Type} + ${Endpoint} ) begin { @@ -1578,6 +1647,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1599,9 +1671,6 @@ begin { $mapping = @{ __AllParameterSets = 'Az.ServiceLinker.custom\New-AzServiceLinkerConfluentBootstrapServerObject'; } - if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Type')) { - $PSBoundParameters['Type'] = "ConfluentBootstrapServer" - } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ @@ -1609,6 +1678,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1661,27 +1733,19 @@ Create an in-memory object for ConfluentSchemaRegistry. New-AzServiceLinkerConfluentSchemaRegistryObject -Endpoint "https://psrc-xxxx.westus2.azure.confluent.cloud" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfluentSchemaRegistry +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfluentSchemaRegistry .Link https://learn.microsoft.com/powershell/module/az.ServiceLinker/new-azservicelinkerconfluentschemaregistryobject #> function New-AzServiceLinkerConfluentSchemaRegistryObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfluentSchemaRegistry])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfluentSchemaRegistry])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] [System.String] # The endpoint of service. - ${Endpoint}, - - [Parameter(DontShow)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType])] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo(Script='"ConfluentSchemaRegistry"')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType] - # The target service type. - ${Type} + ${Endpoint} ) begin { @@ -1691,6 +1755,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1712,9 +1779,6 @@ begin { $mapping = @{ __AllParameterSets = 'Az.ServiceLinker.custom\New-AzServiceLinkerConfluentSchemaRegistryObject'; } - if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Type')) { - $PSBoundParameters['Type'] = "ConfluentSchemaRegistry" - } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ @@ -1722,6 +1786,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1778,22 +1845,22 @@ $authInfo=New-AzServiceLinkerSecretAuthInfoObject -Name testUser -SecretValue ** New-AzServiceLinkerForContainerApp -TargetService $target -AuthInfo $auth -ClientType dotnet -LinkerName testLinker -ContainerApp servicelinker-app -ResourceGroupName servicelinker-test-linux-group -Scope 'simple-hello-world-container' .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource .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. -AUTHINFO : The authentication type. - AuthType : The authentication type. +AUTHINFO : The authentication type. To construct, see NOTES section for AUTHINFO properties and create a hash table. + AuthType : The authentication type. -TARGETSERVICE : The target service properties - Type : The target service type. +TARGETSERVICE : The target service properties To construct, see NOTES section for TARGETSERVICE properties and create a hash table. + Type : The target service type. .Link https://learn.microsoft.com/powershell/module/az.servicelinker/new-azservicelinkerforcontainerapp #> function New-AzServiceLinkerForContainerApp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter()] @@ -1818,30 +1885,30 @@ param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase] # The authentication type. # To construct, see NOTES section for AUTHINFO properties and create a hash table. ${AuthInfo}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase] # The target service properties # To construct, see NOTES section for TARGETSERVICE properties and create a hash table. ${TargetService}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo(Script='"none"')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType] + [System.String] # The application client type ${ClientType}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType] + [System.String] # Optional, indicate whether to apply configurations on source application. # If enable, generate configurations and applied to the source application. # Default is enable. @@ -1850,7 +1917,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations]))] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations]))] [System.Collections.Hashtable] # A dictionary of additional configurations to be added. # Service will auto generate a set of basic configurations and this property is to full fill more customized configurations @@ -1858,7 +1925,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys]))] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys]))] [System.Collections.Hashtable] # Optional. # A dictionary of default key name and customized key name mapping. @@ -1866,16 +1933,16 @@ param( ${ConfigurationInfoCustomizedKey}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType] + [System.String] # Allow Azure services to access the target service if true. ${FirewallRuleAzureService}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType] + [System.String] # Allow caller client IP to access the target service if true. # the property is used when connecting local application to target service. ${FirewallRuleCallerClientIP}, @@ -1888,9 +1955,9 @@ param( ${FirewallRuleIPRange}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType] + [System.String] # Optional. # Indicates public network solution. # If enable, enable public network access of target service with best try. @@ -1917,9 +1984,9 @@ param( ${SecretStoreKeyVaultSecretName}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType] + [System.String] # Type of VNet solution. ${VNetSolutionType}, @@ -2011,6 +2078,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2032,15 +2108,13 @@ begin { $mapping = @{ CreateExpanded = 'Az.ServiceLinker.custom\New-AzServiceLinkerForContainerApp'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Name')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Name') ) { $PSBoundParameters['Name'] = "connect_"+(-join ((65..90) + (97..122) | Get-Random -Count 5 | % {[char]$_})) } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('ClientType')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('ClientType') ) { $PSBoundParameters['ClientType'] = "none" } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -2054,6 +2128,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2112,22 +2189,22 @@ New-AzServiceLinkerForSpringCloud -TargetService $target -AuthInfo $auth -Client .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource .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. -AUTHINFO : The authentication type. - AuthType : The authentication type. +AUTHINFO : The authentication type. To construct, see NOTES section for AUTHINFO properties and create a hash table. + AuthType : The authentication type. -TARGETSERVICE : The target service properties - Type : The target service type. +TARGETSERVICE : The target service properties To construct, see NOTES section for TARGETSERVICE properties and create a hash table. + Type : The target service type. .Link https://learn.microsoft.com/powershell/module/az.servicelinker/new-azservicelinkerforspringcloud #> function New-AzServiceLinkerForSpringCloud { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter()] @@ -2152,30 +2229,30 @@ param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase] # The authentication type. # To construct, see NOTES section for AUTHINFO properties and create a hash table. ${AuthInfo}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase] # The target service properties # To construct, see NOTES section for TARGETSERVICE properties and create a hash table. ${TargetService}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo(Script='"none"')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType] + [System.String] # The application client type ${ClientType}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType] + [System.String] # Optional, indicate whether to apply configurations on source application. # If enable, generate configurations and applied to the source application. # Default is enable. @@ -2184,7 +2261,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations]))] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations]))] [System.Collections.Hashtable] # A dictionary of additional configurations to be added. # Service will auto generate a set of basic configurations and this property is to full fill more customized configurations @@ -2192,7 +2269,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys]))] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys]))] [System.Collections.Hashtable] # Optional. # A dictionary of default key name and customized key name mapping. @@ -2200,16 +2277,16 @@ param( ${ConfigurationInfoCustomizedKey}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType] + [System.String] # Allow Azure services to access the target service if true. ${FirewallRuleAzureService}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType] + [System.String] # Allow caller client IP to access the target service if true. # the property is used when connecting local application to target service. ${FirewallRuleCallerClientIP}, @@ -2222,9 +2299,9 @@ param( ${FirewallRuleIPRange}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType] + [System.String] # Optional. # Indicates public network solution. # If enable, enable public network access of target service with best try. @@ -2251,9 +2328,9 @@ param( ${SecretStoreKeyVaultSecretName}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType] + [System.String] # Type of VNet solution. ${VNetSolutionType}, @@ -2358,6 +2435,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2379,18 +2465,16 @@ begin { $mapping = @{ CreateExpanded = 'Az.ServiceLinker.custom\New-AzServiceLinkerForSpringCloud'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Name')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Name') ) { $PSBoundParameters['Name'] = "connect_"+(-join ((65..90) + (97..122) | Get-Random -Count 5 | % {[char]$_})) } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('ClientType')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('ClientType') ) { $PSBoundParameters['ClientType'] = "none" } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('DeploymentName')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('DeploymentName') ) { $PSBoundParameters['DeploymentName'] = "default" } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -2404,6 +2488,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2460,22 +2547,22 @@ $authInfo=New-AzServiceLinkerSecretAuthInfoObject -Name testUser -SecretValue ** New-AzServiceLinkerForWebApp -TargetService $target -AuthInfo $auth -ClientType dotnet -LinkerName testLinker -WebApp servicelinker-app -ResourceGroupName servicelinker-test-group .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource .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. -AUTHINFO : The authentication type. - AuthType : The authentication type. +AUTHINFO : The authentication type. To construct, see NOTES section for AUTHINFO properties and create a hash table. + AuthType : The authentication type. -TARGETSERVICE : The target service properties - Type : The target service type. +TARGETSERVICE : The target service properties To construct, see NOTES section for TARGETSERVICE properties and create a hash table. + Type : The target service type. .Link https://learn.microsoft.com/powershell/module/az.servicelinker/new-azservicelinkerforwebapp #> function New-AzServiceLinkerForWebApp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter()] @@ -2500,30 +2587,30 @@ param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase] # The authentication type. # To construct, see NOTES section for AUTHINFO properties and create a hash table. ${AuthInfo}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase] # The target service properties # To construct, see NOTES section for TARGETSERVICE properties and create a hash table. ${TargetService}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo(Script='"none"')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType] + [System.String] # The application client type ${ClientType}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType] + [System.String] # Optional, indicate whether to apply configurations on source application. # If enable, generate configurations and applied to the source application. # Default is enable. @@ -2532,7 +2619,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations]))] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations]))] [System.Collections.Hashtable] # A dictionary of additional configurations to be added. # Service will auto generate a set of basic configurations and this property is to full fill more customized configurations @@ -2540,7 +2627,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys]))] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys]))] [System.Collections.Hashtable] # Optional. # A dictionary of default key name and customized key name mapping. @@ -2548,16 +2635,16 @@ param( ${ConfigurationInfoCustomizedKey}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType] + [System.String] # Allow Azure services to access the target service if true. ${FirewallRuleAzureService}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType] + [System.String] # Allow caller client IP to access the target service if true. # the property is used when connecting local application to target service. ${FirewallRuleCallerClientIP}, @@ -2570,9 +2657,9 @@ param( ${FirewallRuleIPRange}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType] + [System.String] # Optional. # Indicates public network solution. # If enable, enable public network access of target service with best try. @@ -2599,9 +2686,9 @@ param( ${SecretStoreKeyVaultSecretName}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType] + [System.String] # Type of VNet solution. ${VNetSolutionType}, @@ -2694,6 +2781,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2715,15 +2811,13 @@ begin { $mapping = @{ CreateExpanded = 'Az.ServiceLinker.custom\New-AzServiceLinkerForWebApp'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Name')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Name') ) { $PSBoundParameters['Name'] = "connect_"+(-join ((65..90) + (97..122) | Get-Random -Count 5 | % {[char]$_})) } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('ClientType')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('ClientType') ) { $PSBoundParameters['ClientType'] = "none" } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -2737,6 +2831,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2793,12 +2890,12 @@ New-AzServiceLinkerSecretAuthInfoObject -Name user -SecretKeyVaultUri "https://s New-AzServiceLinkerSecretAuthInfoObject -Name user -SecretNameInKeyVault test-secret .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretAuthInfo +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretAuthInfo .Link https://learn.microsoft.com/powershell/module/az.ServiceLinker/new-azservicelinkersecretauthinfoobject #> function New-AzServiceLinkerSecretAuthInfoObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretAuthInfo])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretAuthInfo])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] @@ -2809,9 +2906,8 @@ param( [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBase] # Password or key vault secret for secret auth. - # To construct, see NOTES section for SECRETINFO properties and create a hash table. ${SecretInfo}, [Parameter()] @@ -2830,15 +2926,7 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] [System.String] # The name of secret in keyvault refenced by -SecretStoreKeyVaultId. - ${SecretNameInKeyVault}, - - [Parameter(DontShow)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType])] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo(Script='"secret"')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType] - # The authentication type. - ${AuthType} + ${SecretNameInKeyVault} ) begin { @@ -2848,6 +2936,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2869,9 +2960,6 @@ begin { $mapping = @{ __AllParameterSets = 'Az.ServiceLinker.custom\New-AzServiceLinkerSecretAuthInfoObject'; } - if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('AuthType')) { - $PSBoundParameters['AuthType'] = "secret" - } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ @@ -2879,6 +2967,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2931,12 +3022,12 @@ Create an in-memory object for ServicePrincipalSecretAuthInfo. New-AzServiceLinkerServicePrincipalSecretAuthInfoObject -ClientId 00000000-0000-0000-0000-000000000000 -PrincipalId 00000000-0000-0000-0000-000000000000 -Secret secret .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ServicePrincipalSecretAuthInfo +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ServicePrincipalSecretAuthInfo .Link https://learn.microsoft.com/powershell/module/az.ServiceLinker/new-azservicelinkerserviceprincipalsecretauthinfoobject #> function New-AzServiceLinkerServicePrincipalSecretAuthInfoObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ServicePrincipalSecretAuthInfo])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ServicePrincipalSecretAuthInfo])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -2957,13 +3048,18 @@ param( # Secret for servicePrincipal auth. ${Secret}, - [Parameter(DontShow)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType])] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo(Script='"servicePrincipalSecret"')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType] - # The authentication type. - ${AuthType} + [System.String[]] + # Optional, this value specifies the Azure roles to be assigned. + # Automatically . + ${Role}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] + [System.String] + # Username created in the database which is mapped to a user in AAD. + ${UserName} ) begin { @@ -2973,6 +3069,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2994,9 +3093,6 @@ begin { $mapping = @{ __AllParameterSets = 'Az.ServiceLinker.custom\New-AzServiceLinkerServicePrincipalSecretAuthInfoObject'; } - if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('AuthType')) { - $PSBoundParameters['AuthType'] = "servicePrincipalSecret" - } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ @@ -3004,6 +3100,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -3056,21 +3155,25 @@ Create an in-memory object for SystemAssignedIdentityAuthInfo. New-AzServiceLinkerSystemAssignedIdentityAuthInfoObject .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SystemAssignedIdentityAuthInfo +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SystemAssignedIdentityAuthInfo .Link https://learn.microsoft.com/powershell/module/az.ServiceLinker/new-azservicelinkersystemassignedidentityauthinfoobject #> function New-AzServiceLinkerSystemAssignedIdentityAuthInfoObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SystemAssignedIdentityAuthInfo])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SystemAssignedIdentityAuthInfo])] [CmdletBinding(PositionalBinding=$false)] param( - [Parameter(DontShow)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType])] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo(Script='"systemAssignedIdentity"')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType] - # The authentication type. - ${AuthType} + [System.String[]] + # Optional, this value specifies the Azure role to be assigned. + ${Role}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] + [System.String] + # Username created in the database which is mapped to a user in AAD. + ${UserName} ) begin { @@ -3080,6 +3183,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -3101,9 +3207,6 @@ begin { $mapping = @{ __AllParameterSets = 'Az.ServiceLinker.custom\New-AzServiceLinkerSystemAssignedIdentityAuthInfoObject'; } - if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('AuthType')) { - $PSBoundParameters['AuthType'] = "systemAssignedIdentity" - } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ @@ -3111,6 +3214,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -3163,12 +3269,12 @@ Create an in-memory object for UserAssignedIdentityAuthInfo. New-AzServiceLinkerUserAssignedIdentityAuthInfoObject -ClientId 00000000-0000-0000-0000-000000000000 -SubscriptionId 00000000-0000-0000-0000-000000000000 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.UserAssignedIdentityAuthInfo +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.UserAssignedIdentityAuthInfo .Link https://learn.microsoft.com/powershell/module/az.ServiceLinker/new-azservicelinkeruserassignedidentityauthinfoobject #> function New-AzServiceLinkerUserAssignedIdentityAuthInfoObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.UserAssignedIdentityAuthInfo])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.UserAssignedIdentityAuthInfo])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] @@ -3177,19 +3283,23 @@ param( # Client Id for userAssignedIdentity. ${ClientId}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] + [System.String[]] + # Optional, this value specifies the Azure role to be assigned. + ${Role}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] [System.String] # Subscription id for userAssignedIdentity. ${SubscriptionId}, - [Parameter(DontShow)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType])] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo(Script='"userAssignedIdentity"')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType] - # The authentication type. - ${AuthType} + [System.String] + # Username created in the database which is mapped to a user in AAD. + ${UserName} ) begin { @@ -3199,6 +3309,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -3220,9 +3333,6 @@ begin { $mapping = @{ __AllParameterSets = 'Az.ServiceLinker.custom\New-AzServiceLinkerUserAssignedIdentityAuthInfoObject'; } - if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('AuthType')) { - $PSBoundParameters['AuthType'] = "userAssignedIdentity" - } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ @@ -3230,6 +3340,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -3290,7 +3403,7 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ConnectorName ]: The name of resource. [DryrunName ]: The name of dryrun. [Id ]: Resource identity path @@ -3419,6 +3532,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -3441,9 +3563,7 @@ begin { Delete = 'Az.ServiceLinker.custom\Remove-AzServiceLinkerForContainerApp'; DeleteViaIdentity = 'Az.ServiceLinker.custom\Remove-AzServiceLinkerForContainerApp'; } - if (('Delete', 'DeleteViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete', 'DeleteViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -3457,6 +3577,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -3517,7 +3640,7 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ConnectorName ]: The name of resource. [DryrunName ]: The name of dryrun. [Id ]: Resource identity path @@ -3659,6 +3782,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -3681,12 +3813,10 @@ begin { Delete = 'Az.ServiceLinker.custom\Remove-AzServiceLinkerForSpringCloud'; DeleteViaIdentity = 'Az.ServiceLinker.custom\Remove-AzServiceLinkerForSpringCloud'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('DeploymentName')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('DeploymentName') ) { $PSBoundParameters['DeploymentName'] = "default" } - if (('Delete', 'DeleteViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete', 'DeleteViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -3700,6 +3830,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -3760,7 +3893,7 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ConnectorName ]: The name of resource. [DryrunName ]: The name of dryrun. [Id ]: Resource identity path @@ -3889,6 +4022,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -3911,9 +4053,7 @@ begin { Delete = 'Az.ServiceLinker.custom\Remove-AzServiceLinkerForWebApp'; DeleteViaIdentity = 'Az.ServiceLinker.custom\Remove-AzServiceLinkerForWebApp'; } - if (('Delete', 'DeleteViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete', 'DeleteViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -3927,6 +4067,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -3981,13 +4124,13 @@ Test-AzServiceLinkerForContainerApp -ContainerApp servicelinker-app -ResourceGro .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ConnectorName ]: The name of resource. [DryrunName ]: The name of dryrun. [Id ]: Resource identity path @@ -4000,7 +4143,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.servicelinker/test-azservicelinkerforcontainerapp #> function Test-AzServiceLinkerForContainerApp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult])] [CmdletBinding(DefaultParameterSetName='Validate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Validate', Mandatory)] @@ -4110,6 +4253,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -4132,9 +4284,7 @@ begin { Validate = 'Az.ServiceLinker.custom\Test-AzServiceLinkerForContainerApp'; ValidateViaIdentity = 'Az.ServiceLinker.custom\Test-AzServiceLinkerForContainerApp'; } - if (('Validate', 'ValidateViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Validate', 'ValidateViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -4148,6 +4298,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -4202,13 +4355,13 @@ Test-AzServiceLinkerForSpringCloud -ServiceName servicelinker-springcloud -AppNa .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ConnectorName ]: The name of resource. [DryrunName ]: The name of dryrun. [Id ]: Resource identity path @@ -4221,7 +4374,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.servicelinker/test-azservicelinkerforspringcloud #> function Test-AzServiceLinkerForSpringCloud { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult])] [CmdletBinding(DefaultParameterSetName='Validate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Validate', Mandatory)] @@ -4344,6 +4497,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -4366,12 +4528,10 @@ begin { Validate = 'Az.ServiceLinker.custom\Test-AzServiceLinkerForSpringCloud'; ValidateViaIdentity = 'Az.ServiceLinker.custom\Test-AzServiceLinkerForSpringCloud'; } - if (('Validate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('DeploymentName')) { + if (('Validate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('DeploymentName') ) { $PSBoundParameters['DeploymentName'] = "default" } - if (('Validate', 'ValidateViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Validate', 'ValidateViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -4385,6 +4545,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -4439,13 +4602,13 @@ Test-AzServiceLinkerForWebApp -WebApp servicelinker-webapp -ResourceGroupName se .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ConnectorName ]: The name of resource. [DryrunName ]: The name of dryrun. [Id ]: Resource identity path @@ -4458,7 +4621,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.servicelinker/test-azservicelinkerforwebapp #> function Test-AzServiceLinkerForWebApp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult])] [CmdletBinding(DefaultParameterSetName='Validate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Validate', Mandatory)] @@ -4568,6 +4731,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -4590,9 +4762,7 @@ begin { Validate = 'Az.ServiceLinker.custom\Test-AzServiceLinkerForWebApp'; ValidateViaIdentity = 'Az.ServiceLinker.custom\Test-AzServiceLinkerForWebApp'; } - if (('Validate', 'ValidateViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Validate', 'ValidateViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -4606,6 +4776,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -4662,16 +4835,16 @@ Update-AzServiceLinkerForContainerApp -ResourceGroupName servicelinker-test-linu .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource .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. -AUTHINFO : The authentication type. - AuthType : The authentication type. +AUTHINFO : The authentication type. To construct, see NOTES section for AUTHINFO properties and create a hash table. + AuthType : The authentication type. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ConnectorName ]: The name of resource. [DryrunName ]: The name of dryrun. [Id ]: Resource identity path @@ -4681,13 +4854,13 @@ INPUTOBJECT : Identity Parameter [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. [SubscriptionId ]: The ID of the target subscription. -TARGETSERVICE : The target service properties - Type : The target service type. +TARGETSERVICE : The target service properties To construct, see NOTES section for TARGETSERVICE properties and create a hash table. + Type : The target service type. .Link https://learn.microsoft.com/powershell/module/az.servicelinker/update-azservicelinkerforcontainerapp #> function Update-AzServiceLinkerForContainerApp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -4718,15 +4891,15 @@ param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase] # The authentication type. # To construct, see NOTES section for AUTHINFO properties and create a hash table. ${AuthInfo}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType] + [System.String] # The application client type ${ClientType}, @@ -4738,7 +4911,7 @@ param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase] # The target service properties # To construct, see NOTES section for TARGETSERVICE properties and create a hash table. ${TargetService}, @@ -4750,9 +4923,9 @@ param( ${SecretStoreKeyVaultId}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType] + [System.String] # Type of VNet solution. ${VNetSolutionType}, @@ -4843,6 +5016,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -4865,9 +5047,7 @@ begin { UpdateExpanded = 'Az.ServiceLinker.custom\Update-AzServiceLinkerForContainerApp'; UpdateViaIdentityExpanded = 'Az.ServiceLinker.custom\Update-AzServiceLinkerForContainerApp'; } - if (('UpdateExpanded', 'UpdateViaIdentityExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaIdentityExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -4881,6 +5061,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -4937,16 +5120,16 @@ Update-AzServiceLinkerForSpringCloud -ServiceName servicelinker-springcloud -App .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource .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. -AUTHINFO : The authentication type. - AuthType : The authentication type. +AUTHINFO : The authentication type. To construct, see NOTES section for AUTHINFO properties and create a hash table. + AuthType : The authentication type. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ConnectorName ]: The name of resource. [DryrunName ]: The name of dryrun. [Id ]: Resource identity path @@ -4956,13 +5139,13 @@ INPUTOBJECT : Identity Parameter [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. [SubscriptionId ]: The ID of the target subscription. -TARGETSERVICE : The target service properties - Type : The target service type. +TARGETSERVICE : The target service properties To construct, see NOTES section for TARGETSERVICE properties and create a hash table. + Type : The target service type. .Link https://learn.microsoft.com/powershell/module/az.servicelinker/update-azservicelinkerforspringcloud #> function Update-AzServiceLinkerForSpringCloud { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -4993,21 +5176,21 @@ param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase] # The authentication type. # To construct, see NOTES section for AUTHINFO properties and create a hash table. ${AuthInfo}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType] + [System.String] # The application client type ${ClientType}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase] # The target service properties # To construct, see NOTES section for TARGETSERVICE properties and create a hash table. ${TargetService}, @@ -5025,9 +5208,9 @@ param( ${SecretStoreKeyVaultId}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType] + [System.String] # Type of VNet solution. ${VNetSolutionType}, @@ -5131,6 +5314,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -5153,12 +5345,10 @@ begin { UpdateExpanded = 'Az.ServiceLinker.custom\Update-AzServiceLinkerForSpringCloud'; UpdateViaIdentityExpanded = 'Az.ServiceLinker.custom\Update-AzServiceLinkerForSpringCloud'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('DeploymentName')) { + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('DeploymentName') ) { $PSBoundParameters['DeploymentName'] = "default" } - if (('UpdateExpanded', 'UpdateViaIdentityExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaIdentityExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -5172,6 +5362,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -5228,16 +5421,16 @@ Update-AzServiceLinkerForWebApp -ResourceGroupName servicelinker-test-linux-grou .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource .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. -AUTHINFO : The authentication type. - AuthType : The authentication type. +AUTHINFO : The authentication type. To construct, see NOTES section for AUTHINFO properties and create a hash table. + AuthType : The authentication type. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ConnectorName ]: The name of resource. [DryrunName ]: The name of dryrun. [Id ]: Resource identity path @@ -5247,13 +5440,13 @@ INPUTOBJECT : Identity Parameter [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. [SubscriptionId ]: The ID of the target subscription. -TARGETSERVICE : The target service properties - Type : The target service type. +TARGETSERVICE : The target service properties To construct, see NOTES section for TARGETSERVICE properties and create a hash table. + Type : The target service type. .Link https://learn.microsoft.com/powershell/module/az.servicelinker/update-azservicelinkerforwebapp #> function Update-AzServiceLinkerForWebApp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -5284,21 +5477,21 @@ param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase] # The authentication type. # To construct, see NOTES section for AUTHINFO properties and create a hash table. ${AuthInfo}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType] + [System.String] # The application client type ${ClientType}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase] # The target service properties # To construct, see NOTES section for TARGETSERVICE properties and create a hash table. ${TargetService}, @@ -5316,9 +5509,9 @@ param( ${SecretStoreKeyVaultId}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType] + [System.String] # Type of VNet solution. ${VNetSolutionType}, @@ -5409,6 +5602,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -5431,9 +5633,7 @@ begin { UpdateExpanded = 'Az.ServiceLinker.custom\Update-AzServiceLinkerForWebApp'; UpdateViaIdentityExpanded = 'Az.ServiceLinker.custom\Update-AzServiceLinkerForWebApp'; } - if (('UpdateExpanded', 'UpdateViaIdentityExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaIdentityExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -5447,6 +5647,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Remove-AzServiceLinkerForContainerApp.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Remove-AzServiceLinkerForContainerApp.ps1 index ae047c98be1e..cbd5a14fef20 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Remove-AzServiceLinkerForContainerApp.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Remove-AzServiceLinkerForContainerApp.ps1 @@ -31,7 +31,7 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ConnectorName ]: The name of resource. [DryrunName ]: The name of dryrun. [Id ]: Resource identity path @@ -160,6 +160,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -182,9 +191,7 @@ begin { Delete = 'Az.ServiceLinker.custom\Remove-AzServiceLinkerForContainerApp'; DeleteViaIdentity = 'Az.ServiceLinker.custom\Remove-AzServiceLinkerForContainerApp'; } - if (('Delete', 'DeleteViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete', 'DeleteViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -198,6 +205,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Remove-AzServiceLinkerForSpringcloud.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Remove-AzServiceLinkerForSpringcloud.ps1 index bb7de954799b..e5193d657ecc 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Remove-AzServiceLinkerForSpringcloud.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Remove-AzServiceLinkerForSpringcloud.ps1 @@ -31,7 +31,7 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ConnectorName ]: The name of resource. [DryrunName ]: The name of dryrun. [Id ]: Resource identity path @@ -173,6 +173,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -195,12 +204,10 @@ begin { Delete = 'Az.ServiceLinker.custom\Remove-AzServiceLinkerForSpringCloud'; DeleteViaIdentity = 'Az.ServiceLinker.custom\Remove-AzServiceLinkerForSpringCloud'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('DeploymentName')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('DeploymentName') ) { $PSBoundParameters['DeploymentName'] = "default" } - if (('Delete', 'DeleteViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete', 'DeleteViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -214,6 +221,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Remove-AzServiceLinkerForWebApp.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Remove-AzServiceLinkerForWebApp.ps1 index b70f179daf95..a2bd9c67240e 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Remove-AzServiceLinkerForWebApp.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Remove-AzServiceLinkerForWebApp.ps1 @@ -31,7 +31,7 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ConnectorName ]: The name of resource. [DryrunName ]: The name of dryrun. [Id ]: Resource identity path @@ -160,6 +160,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -182,9 +191,7 @@ begin { Delete = 'Az.ServiceLinker.custom\Remove-AzServiceLinkerForWebApp'; DeleteViaIdentity = 'Az.ServiceLinker.custom\Remove-AzServiceLinkerForWebApp'; } - if (('Delete', 'DeleteViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete', 'DeleteViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -198,6 +205,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Test-AzServiceLinkerForContainerApp.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Test-AzServiceLinkerForContainerApp.ps1 index 8171d4d374a1..dfe6268a1fab 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Test-AzServiceLinkerForContainerApp.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Test-AzServiceLinkerForContainerApp.ps1 @@ -25,13 +25,13 @@ Test-AzServiceLinkerForContainerApp -ContainerApp servicelinker-app -ResourceGro .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ConnectorName ]: The name of resource. [DryrunName ]: The name of dryrun. [Id ]: Resource identity path @@ -44,7 +44,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.servicelinker/test-azservicelinkerforcontainerapp #> function Test-AzServiceLinkerForContainerApp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult])] [CmdletBinding(DefaultParameterSetName='Validate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Validate', Mandatory)] @@ -154,6 +154,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -176,9 +185,7 @@ begin { Validate = 'Az.ServiceLinker.custom\Test-AzServiceLinkerForContainerApp'; ValidateViaIdentity = 'Az.ServiceLinker.custom\Test-AzServiceLinkerForContainerApp'; } - if (('Validate', 'ValidateViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Validate', 'ValidateViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -192,6 +199,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Test-AzServiceLinkerForSpringCloud.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Test-AzServiceLinkerForSpringCloud.ps1 index 3f1d016d01c1..ec76e53b6977 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Test-AzServiceLinkerForSpringCloud.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Test-AzServiceLinkerForSpringCloud.ps1 @@ -25,13 +25,13 @@ Test-AzServiceLinkerForSpringCloud -ServiceName servicelinker-springcloud -AppNa .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ConnectorName ]: The name of resource. [DryrunName ]: The name of dryrun. [Id ]: Resource identity path @@ -44,7 +44,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.servicelinker/test-azservicelinkerforspringcloud #> function Test-AzServiceLinkerForSpringCloud { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult])] [CmdletBinding(DefaultParameterSetName='Validate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Validate', Mandatory)] @@ -167,6 +167,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -189,12 +198,10 @@ begin { Validate = 'Az.ServiceLinker.custom\Test-AzServiceLinkerForSpringCloud'; ValidateViaIdentity = 'Az.ServiceLinker.custom\Test-AzServiceLinkerForSpringCloud'; } - if (('Validate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('DeploymentName')) { + if (('Validate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('DeploymentName') ) { $PSBoundParameters['DeploymentName'] = "default" } - if (('Validate', 'ValidateViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Validate', 'ValidateViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -208,6 +215,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Test-AzServiceLinkerForWebApp.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Test-AzServiceLinkerForWebApp.ps1 index e3390c631b1d..32e8ead2d5b0 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Test-AzServiceLinkerForWebApp.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Test-AzServiceLinkerForWebApp.ps1 @@ -25,13 +25,13 @@ Test-AzServiceLinkerForWebApp -WebApp servicelinker-webapp -ResourceGroupName se .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ConnectorName ]: The name of resource. [DryrunName ]: The name of dryrun. [Id ]: Resource identity path @@ -44,7 +44,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.servicelinker/test-azservicelinkerforwebapp #> function Test-AzServiceLinkerForWebApp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult])] [CmdletBinding(DefaultParameterSetName='Validate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Validate', Mandatory)] @@ -154,6 +154,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -176,9 +185,7 @@ begin { Validate = 'Az.ServiceLinker.custom\Test-AzServiceLinkerForWebApp'; ValidateViaIdentity = 'Az.ServiceLinker.custom\Test-AzServiceLinkerForWebApp'; } - if (('Validate', 'ValidateViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Validate', 'ValidateViaIdentity') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -192,6 +199,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Update-AzServiceLinkerForContainerApp.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Update-AzServiceLinkerForContainerApp.ps1 index c03fa7aa2109..f35347b09378 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Update-AzServiceLinkerForContainerApp.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Update-AzServiceLinkerForContainerApp.ps1 @@ -27,16 +27,16 @@ Update-AzServiceLinkerForContainerApp -ResourceGroupName servicelinker-test-linu .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource .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. -AUTHINFO : The authentication type. - AuthType : The authentication type. +AUTHINFO : The authentication type. To construct, see NOTES section for AUTHINFO properties and create a hash table. + AuthType : The authentication type. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ConnectorName ]: The name of resource. [DryrunName ]: The name of dryrun. [Id ]: Resource identity path @@ -46,13 +46,13 @@ INPUTOBJECT : Identity Parameter [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. [SubscriptionId ]: The ID of the target subscription. -TARGETSERVICE : The target service properties - Type : The target service type. +TARGETSERVICE : The target service properties To construct, see NOTES section for TARGETSERVICE properties and create a hash table. + Type : The target service type. .Link https://learn.microsoft.com/powershell/module/az.servicelinker/update-azservicelinkerforcontainerapp #> function Update-AzServiceLinkerForContainerApp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -83,15 +83,15 @@ param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase] # The authentication type. # To construct, see NOTES section for AUTHINFO properties and create a hash table. ${AuthInfo}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType] + [System.String] # The application client type ${ClientType}, @@ -103,7 +103,7 @@ param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase] # The target service properties # To construct, see NOTES section for TARGETSERVICE properties and create a hash table. ${TargetService}, @@ -115,9 +115,9 @@ param( ${SecretStoreKeyVaultId}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType] + [System.String] # Type of VNet solution. ${VNetSolutionType}, @@ -208,6 +208,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -230,9 +239,7 @@ begin { UpdateExpanded = 'Az.ServiceLinker.custom\Update-AzServiceLinkerForContainerApp'; UpdateViaIdentityExpanded = 'Az.ServiceLinker.custom\Update-AzServiceLinkerForContainerApp'; } - if (('UpdateExpanded', 'UpdateViaIdentityExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaIdentityExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -246,6 +253,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Update-AzServiceLinkerForSpringCloud.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Update-AzServiceLinkerForSpringCloud.ps1 index 068846913095..883e60274b29 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Update-AzServiceLinkerForSpringCloud.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Update-AzServiceLinkerForSpringCloud.ps1 @@ -27,16 +27,16 @@ Update-AzServiceLinkerForSpringCloud -ServiceName servicelinker-springcloud -App .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource .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. -AUTHINFO : The authentication type. - AuthType : The authentication type. +AUTHINFO : The authentication type. To construct, see NOTES section for AUTHINFO properties and create a hash table. + AuthType : The authentication type. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ConnectorName ]: The name of resource. [DryrunName ]: The name of dryrun. [Id ]: Resource identity path @@ -46,13 +46,13 @@ INPUTOBJECT : Identity Parameter [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. [SubscriptionId ]: The ID of the target subscription. -TARGETSERVICE : The target service properties - Type : The target service type. +TARGETSERVICE : The target service properties To construct, see NOTES section for TARGETSERVICE properties and create a hash table. + Type : The target service type. .Link https://learn.microsoft.com/powershell/module/az.servicelinker/update-azservicelinkerforspringcloud #> function Update-AzServiceLinkerForSpringCloud { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -83,21 +83,21 @@ param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase] # The authentication type. # To construct, see NOTES section for AUTHINFO properties and create a hash table. ${AuthInfo}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType] + [System.String] # The application client type ${ClientType}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase] # The target service properties # To construct, see NOTES section for TARGETSERVICE properties and create a hash table. ${TargetService}, @@ -115,9 +115,9 @@ param( ${SecretStoreKeyVaultId}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType] + [System.String] # Type of VNet solution. ${VNetSolutionType}, @@ -221,6 +221,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -243,12 +252,10 @@ begin { UpdateExpanded = 'Az.ServiceLinker.custom\Update-AzServiceLinkerForSpringCloud'; UpdateViaIdentityExpanded = 'Az.ServiceLinker.custom\Update-AzServiceLinkerForSpringCloud'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('DeploymentName')) { + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('DeploymentName') ) { $PSBoundParameters['DeploymentName'] = "default" } - if (('UpdateExpanded', 'UpdateViaIdentityExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaIdentityExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -262,6 +269,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Update-AzServiceLinkerForWebApp.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Update-AzServiceLinkerForWebApp.ps1 index a1d145bfa43b..fb2056242d2f 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/exports/Update-AzServiceLinkerForWebApp.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/exports/Update-AzServiceLinkerForWebApp.ps1 @@ -27,16 +27,16 @@ Update-AzServiceLinkerForWebApp -ResourceGroupName servicelinker-test-linux-grou .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource .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. -AUTHINFO : The authentication type. - AuthType : The authentication type. +AUTHINFO : The authentication type. To construct, see NOTES section for AUTHINFO properties and create a hash table. + AuthType : The authentication type. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ConnectorName ]: The name of resource. [DryrunName ]: The name of dryrun. [Id ]: Resource identity path @@ -46,13 +46,13 @@ INPUTOBJECT : Identity Parameter [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. [SubscriptionId ]: The ID of the target subscription. -TARGETSERVICE : The target service properties - Type : The target service type. +TARGETSERVICE : The target service properties To construct, see NOTES section for TARGETSERVICE properties and create a hash table. + Type : The target service type. .Link https://learn.microsoft.com/powershell/module/az.servicelinker/update-azservicelinkerforwebapp #> function Update-AzServiceLinkerForWebApp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -83,21 +83,21 @@ param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase] # The authentication type. # To construct, see NOTES section for AUTHINFO properties and create a hash table. ${AuthInfo}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType] + [System.String] # The application client type ${ClientType}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase] # The target service properties # To construct, see NOTES section for TARGETSERVICE properties and create a hash table. ${TargetService}, @@ -115,9 +115,9 @@ param( ${SecretStoreKeyVaultId}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType] + [System.String] # Type of VNet solution. ${VNetSolutionType}, @@ -208,6 +208,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -230,9 +239,7 @@ begin { UpdateExpanded = 'Az.ServiceLinker.custom\Update-AzServiceLinkerForWebApp'; UpdateViaIdentityExpanded = 'Az.ServiceLinker.custom\Update-AzServiceLinkerForWebApp'; } - if (('UpdateExpanded', 'UpdateViaIdentityExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaIdentityExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -246,6 +253,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generate-info.json b/generated/ServiceLinker/ServiceLinker.Autorest/generate-info.json index d91bd5de624c..1dc67d099da4 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generate-info.json +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "1f7e5d7b-9f7e-4235-8e00-5e2f6a3c1ed8" + "generate_Id": "7c01552d-641c-4637-8009-6b16c5c1c92b" } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/Module.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/Module.cs index 755ec5485cce..6aca59803b26 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/Module.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/Module.cs @@ -28,12 +28,20 @@ public partial class Module public global::System.Net.Http.HttpClientHandler _handler = new global::System.Net.Http.HttpClientHandler(); + private static bool _init = false; + + private static readonly global::System.Object _initLock = new global::System.Object(); + + private static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module _instance; + /// the ISendAsync pipeline instance private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline _pipeline; /// the ISendAsync pipeline instance (when proxy is enabled) private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline _pipelineWithProxy; + private static readonly global::System.Object _singletonLock = new global::System.Object(); + public bool _useProxy = false; public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy(); @@ -56,11 +64,8 @@ public partial class Module /// The delegate to get the telemetry info. public GetTelemetryInfoDelegate GetTelemetryInfo { get; set; } - /// Backing field for property. - private static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module _instance; - /// the singleton of this module class - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module()); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module Instance { get { if (_instance == null) { lock (_singletonLock) { if (_instance == null) { _instance = new Module(); }}} return _instance; } } /// The Name of this module public string Name => @"Az.ServiceLinker"; @@ -125,9 +130,17 @@ public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Cre /// Initialization steps performed after the module is loaded. public void Init() { - OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } ); - OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } ); - CustomInit(); + if (_init == false) + { + lock (_initLock) { + if (_init == false) { + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } ); + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } ); + CustomInit(); + _init = true; + } + } + } } /// Creates the module instance. diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AccessKeyInfoBase.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AccessKeyInfoBase.PowerShell.cs similarity index 73% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AccessKeyInfoBase.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AccessKeyInfoBase.PowerShell.cs index 1207022000ec..d6aac0a79911 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AccessKeyInfoBase.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AccessKeyInfoBase.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -57,7 +57,15 @@ public partial class AccessKeyInfoBase partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -72,17 +80,17 @@ internal AccessKeyInfoBase(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Permission")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAccessKeyInfoBaseInternal)this).Permission = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AccessKeyPermissions[]) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAccessKeyInfoBaseInternal)this).Permission, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AccessKeyPermissions.CreateFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAccessKeyInfoBaseInternal)this).Permission = (System.Collections.Generic.List) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAccessKeyInfoBaseInternal)this).Permission, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("AuthType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType = (string) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -97,39 +105,37 @@ internal AccessKeyInfoBase(global::System.Management.Automation.PSObject content // actually deserialize if (content.Contains("Permission")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAccessKeyInfoBaseInternal)this).Permission = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AccessKeyPermissions[]) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAccessKeyInfoBaseInternal)this).Permission, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AccessKeyPermissions.CreateFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAccessKeyInfoBaseInternal)this).Permission = (System.Collections.Generic.List) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAccessKeyInfoBaseInternal)this).Permission, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("AuthType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType = (string) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAccessKeyInfoBase DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAccessKeyInfoBase DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AccessKeyInfoBase(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAccessKeyInfoBase DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAccessKeyInfoBase DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AccessKeyInfoBase(content); } @@ -139,12 +145,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAccessKeyInfoBase FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAccessKeyInfoBase FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The access key directly from target resource properties, which target service is Azure Resource, such as Microsoft.Storage [System.ComponentModel.TypeConverter(typeof(AccessKeyInfoBaseTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AccessKeyInfoBase.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AccessKeyInfoBase.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AccessKeyInfoBase.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AccessKeyInfoBase.TypeConverter.cs index e2c2d8940c92..3eb7e85d0f4d 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AccessKeyInfoBase.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AccessKeyInfoBase.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAccessKeyInfoBase ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAccessKeyInfoBase ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAccessKeyInfoBase).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAccessKeyInfoBase).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AccessKeyInfoBase.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AccessKeyInfoBase.cs similarity index 74% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AccessKeyInfoBase.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AccessKeyInfoBase.cs index 4401f3036b93..542f07529a9a 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AccessKeyInfoBase.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AccessKeyInfoBase.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -11,34 +11,34 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Pre /// The access key directly from target resource properties, which target service is Azure Resource, such as Microsoft.Storage /// public partial class AccessKeyInfoBase : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAccessKeyInfoBase, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAccessKeyInfoBaseInternal, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAccessKeyInfoBase, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAccessKeyInfoBaseInternal, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AuthInfoBase(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AuthInfoBase(); /// The authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Constant] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType AuthType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)__authInfoBase).AuthType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)__authInfoBase).AuthType = value ; } + public string AuthType { get => "accessKey"; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)__authInfoBase).AuthType = "accessKey"; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AccessKeyPermissions[] _permission; + private System.Collections.Generic.List _permission; /// /// Permissions of the accessKey. `Read` and `Write` are for Azure Cosmos DB and Azure App Configuration, `Listen`, `Send` /// and `Manage` are for Azure Event Hub and Azure Service Bus. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AccessKeyPermissions[] Permission { get => this._permission; set => this._permission = value; } + public System.Collections.Generic.List Permission { get => this._permission; set => this._permission = value; } /// Creates an new instance. public AccessKeyInfoBase() { - + this.__authInfoBase.AuthType = "accessKey"; } /// Validates that this object meets the validation criteria. @@ -56,7 +56,7 @@ public AccessKeyInfoBase() /// The access key directly from target resource properties, which target service is Azure Resource, such as Microsoft.Storage public partial interface IAccessKeyInfoBase : Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase { /// /// Permissions of the accessKey. `Read` and `Write` are for Azure Cosmos DB and Azure App Configuration, `Listen`, `Send` @@ -65,21 +65,26 @@ public partial interface IAccessKeyInfoBase : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Permissions of the accessKey. `Read` and `Write` are for Azure Cosmos DB and Azure App Configuration, `Listen`, `Send` and `Manage` are for Azure Event Hub and Azure Service Bus.", SerializedName = @"permissions", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AccessKeyPermissions) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AccessKeyPermissions[] Permission { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Read", "Write", "Listen", "Send", "Manage")] + System.Collections.Generic.List Permission { get; set; } } /// The access key directly from target resource properties, which target service is Azure Resource, such as Microsoft.Storage internal partial interface IAccessKeyInfoBaseInternal : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal { /// /// Permissions of the accessKey. `Read` and `Write` are for Azure Cosmos DB and Azure App Configuration, `Listen`, `Send` /// and `Manage` are for Azure Event Hub and Azure Service Bus. /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AccessKeyPermissions[] Permission { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Read", "Write", "Listen", "Send", "Manage")] + System.Collections.Generic.List Permission { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AccessKeyInfoBase.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AccessKeyInfoBase.json.cs similarity index 88% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AccessKeyInfoBase.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AccessKeyInfoBase.json.cs index a27131093baa..63add6901734 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AccessKeyInfoBase.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AccessKeyInfoBase.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -67,19 +67,19 @@ internal AccessKeyInfoBase(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runt { return; } - __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AuthInfoBase(json); - {_permission = If( json?.PropertyT("permissions"), out var __jsonPermissions) ? If( __jsonPermissions as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Support.AccessKeyPermissions) (__u is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AccessKeyPermissions)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AccessKeyPermissions)""))) ))() : null : Permission;} + __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AuthInfoBase(json); + {_permission = If( json?.PropertyT("permissions"), out var __jsonPermissions) ? If( __jsonPermissions as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _permission;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAccessKeyInfoBase. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAccessKeyInfoBase. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAccessKeyInfoBase. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAccessKeyInfoBase. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAccessKeyInfoBase FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAccessKeyInfoBase FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new AccessKeyInfoBase(json) : null; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Any.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Any.PowerShell.cs index d38d950319f5..ff0ae49359ec 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Any.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Any.PowerShell.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; - /// Any object + /// Anything [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] public partial class Any { @@ -54,6 +54,14 @@ public partial class Any partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + /// /// Deserializes a into a new instance of . @@ -125,8 +133,20 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAny Deser /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } - /// Any object + /// Anything [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] public partial interface IAny diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Any.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Any.cs index 95cb86153d31..af52993511eb 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Any.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Any.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; - /// Any object + /// Anything public partial class Any : Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAny, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAnyInternal @@ -19,13 +19,13 @@ public Any() } } - /// Any object + /// Anything public partial interface IAny : Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IJsonSerializable { } - /// Any object + /// Anything internal partial interface IAnyInternal { diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Any.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Any.json.cs index a56c6022df60..22b0982f1b74 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Any.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Any.json.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; - /// Any object + /// Anything public partial class Any { diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/CreateOrUpdateDryrunParameters.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/CreateOrUpdateDryrunParameters.PowerShell.cs deleted file mode 100644 index 4b749edacbb4..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/CreateOrUpdateDryrunParameters.PowerShell.cs +++ /dev/null @@ -1,330 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; - - /// The dryrun parameters for creation or update a linker - [System.ComponentModel.TypeConverter(typeof(CreateOrUpdateDryrunParametersTypeConverter))] - public partial class CreateOrUpdateDryrunParameters - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should 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 CreateOrUpdateDryrunParameters(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ActionName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParametersInternal)this).ActionName = (string) content.GetValueForProperty("ActionName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParametersInternal)this).ActionName, global::System.Convert.ToString); - } - if (content.Contains("VNetSolutionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).VNetSolutionType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType?) content.GetValueForProperty("VNetSolutionType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).VNetSolutionType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType.CreateFrom); - } - if (content.Contains("PublicNetworkSolutionFirewallRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolutionFirewallRule = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules) content.GetValueForProperty("PublicNetworkSolutionFirewallRule",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolutionFirewallRule, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.FirewallRulesTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationInfoCustomizedKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoCustomizedKey = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys) content.GetValueForProperty("ConfigurationInfoCustomizedKey",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoCustomizedKey, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoCustomizedKeysTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationInfoAdditionalConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoAdditionalConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations) content.GetValueForProperty("ConfigurationInfoAdditionalConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoAdditionalConfiguration, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoAdditionalConfigurationsTypeConverter.ConvertFrom); - } - if (content.Contains("VNetSolutionDeleteOrUpdateBehavior")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).VNetSolutionDeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("VNetSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).VNetSolutionDeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); - } - if (content.Contains("SecretStoreKeyVaultId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).SecretStoreKeyVaultId = (string) content.GetValueForProperty("SecretStoreKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).SecretStoreKeyVaultId, global::System.Convert.ToString); - } - if (content.Contains("SecretStoreKeyVaultSecretName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).SecretStoreKeyVaultSecretName = (string) content.GetValueForProperty("SecretStoreKeyVaultSecretName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).SecretStoreKeyVaultSecretName, global::System.Convert.ToString); - } - if (content.Contains("PublicNetworkSolutionDeleteOrUpdateBehavior")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("PublicNetworkSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); - } - if (content.Contains("PublicNetworkSolutionAction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolutionAction = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType?) content.GetValueForProperty("PublicNetworkSolutionAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolutionAction, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType.CreateFrom); - } - if (content.Contains("FirewallRuleIPRange")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).FirewallRuleIPRange = (string[]) content.GetValueForProperty("FirewallRuleIPRange",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).FirewallRuleIPRange, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ConfigurationInfoDeleteOrUpdateBehavior")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoDeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("ConfigurationInfoDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoDeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); - } - if (content.Contains("ConfigurationInfoAction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoAction = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType?) content.GetValueForProperty("ConfigurationInfoAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoAction, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType.CreateFrom); - } - if (content.Contains("FirewallRuleAzureService")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).FirewallRuleAzureService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType?) content.GetValueForProperty("FirewallRuleAzureService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).FirewallRuleAzureService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType.CreateFrom); - } - if (content.Contains("FirewallRuleCallerClientIP")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).FirewallRuleCallerClientIP = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType?) content.GetValueForProperty("FirewallRuleCallerClientIP",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).FirewallRuleCallerClientIP, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType.CreateFrom); - } - if (content.Contains("VNetSolution")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).VNetSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolution) content.GetValueForProperty("VNetSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).VNetSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.VNetSolutionTypeConverter.ConvertFrom); - } - if (content.Contains("SecretStore")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).SecretStore = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStore) content.GetValueForProperty("SecretStore",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).SecretStore, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretStoreTypeConverter.ConvertFrom); - } - if (content.Contains("PublicNetworkSolution")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolution) content.GetValueForProperty("PublicNetworkSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.PublicNetworkSolutionTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo) content.GetValueForProperty("ConfigurationInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("TargetService")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).TargetService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase) content.GetValueForProperty("TargetService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).TargetService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.TargetServiceBaseTypeConverter.ConvertFrom); - } - if (content.Contains("AuthInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).AuthInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase) content.GetValueForProperty("AuthInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).AuthInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AuthInfoBaseTypeConverter.ConvertFrom); - } - if (content.Contains("ClientType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ClientType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType?) content.GetValueForProperty("ClientType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ClientType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType.CreateFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).Scope, global::System.Convert.ToString); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal CreateOrUpdateDryrunParameters(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ActionName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParametersInternal)this).ActionName = (string) content.GetValueForProperty("ActionName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParametersInternal)this).ActionName, global::System.Convert.ToString); - } - if (content.Contains("VNetSolutionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).VNetSolutionType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType?) content.GetValueForProperty("VNetSolutionType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).VNetSolutionType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType.CreateFrom); - } - if (content.Contains("PublicNetworkSolutionFirewallRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolutionFirewallRule = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules) content.GetValueForProperty("PublicNetworkSolutionFirewallRule",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolutionFirewallRule, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.FirewallRulesTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationInfoCustomizedKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoCustomizedKey = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys) content.GetValueForProperty("ConfigurationInfoCustomizedKey",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoCustomizedKey, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoCustomizedKeysTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationInfoAdditionalConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoAdditionalConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations) content.GetValueForProperty("ConfigurationInfoAdditionalConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoAdditionalConfiguration, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoAdditionalConfigurationsTypeConverter.ConvertFrom); - } - if (content.Contains("VNetSolutionDeleteOrUpdateBehavior")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).VNetSolutionDeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("VNetSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).VNetSolutionDeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); - } - if (content.Contains("SecretStoreKeyVaultId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).SecretStoreKeyVaultId = (string) content.GetValueForProperty("SecretStoreKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).SecretStoreKeyVaultId, global::System.Convert.ToString); - } - if (content.Contains("SecretStoreKeyVaultSecretName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).SecretStoreKeyVaultSecretName = (string) content.GetValueForProperty("SecretStoreKeyVaultSecretName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).SecretStoreKeyVaultSecretName, global::System.Convert.ToString); - } - if (content.Contains("PublicNetworkSolutionDeleteOrUpdateBehavior")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("PublicNetworkSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); - } - if (content.Contains("PublicNetworkSolutionAction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolutionAction = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType?) content.GetValueForProperty("PublicNetworkSolutionAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolutionAction, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType.CreateFrom); - } - if (content.Contains("FirewallRuleIPRange")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).FirewallRuleIPRange = (string[]) content.GetValueForProperty("FirewallRuleIPRange",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).FirewallRuleIPRange, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ConfigurationInfoDeleteOrUpdateBehavior")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoDeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("ConfigurationInfoDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoDeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); - } - if (content.Contains("ConfigurationInfoAction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoAction = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType?) content.GetValueForProperty("ConfigurationInfoAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoAction, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType.CreateFrom); - } - if (content.Contains("FirewallRuleAzureService")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).FirewallRuleAzureService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType?) content.GetValueForProperty("FirewallRuleAzureService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).FirewallRuleAzureService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType.CreateFrom); - } - if (content.Contains("FirewallRuleCallerClientIP")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).FirewallRuleCallerClientIP = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType?) content.GetValueForProperty("FirewallRuleCallerClientIP",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).FirewallRuleCallerClientIP, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType.CreateFrom); - } - if (content.Contains("VNetSolution")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).VNetSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolution) content.GetValueForProperty("VNetSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).VNetSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.VNetSolutionTypeConverter.ConvertFrom); - } - if (content.Contains("SecretStore")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).SecretStore = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStore) content.GetValueForProperty("SecretStore",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).SecretStore, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretStoreTypeConverter.ConvertFrom); - } - if (content.Contains("PublicNetworkSolution")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolution) content.GetValueForProperty("PublicNetworkSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.PublicNetworkSolutionTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo) content.GetValueForProperty("ConfigurationInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("TargetService")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).TargetService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase) content.GetValueForProperty("TargetService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).TargetService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.TargetServiceBaseTypeConverter.ConvertFrom); - } - if (content.Contains("AuthInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).AuthInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase) content.GetValueForProperty("AuthInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).AuthInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AuthInfoBaseTypeConverter.ConvertFrom); - } - if (content.Contains("ClientType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ClientType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType?) content.GetValueForProperty("ClientType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ClientType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType.CreateFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).Scope, 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.ServiceLinker.Models.Api20221101Preview.ICreateOrUpdateDryrunParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new CreateOrUpdateDryrunParameters(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ICreateOrUpdateDryrunParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new CreateOrUpdateDryrunParameters(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ICreateOrUpdateDryrunParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// The dryrun parameters for creation or update a linker - [System.ComponentModel.TypeConverter(typeof(CreateOrUpdateDryrunParametersTypeConverter))] - public partial interface ICreateOrUpdateDryrunParameters - - { - - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/CreateOrUpdateDryrunParameters.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/CreateOrUpdateDryrunParameters.cs deleted file mode 100644 index 470b1024fa9e..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/CreateOrUpdateDryrunParameters.cs +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; - - /// The dryrun parameters for creation or update a linker - public partial class CreateOrUpdateDryrunParameters : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ICreateOrUpdateDryrunParameters, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ICreateOrUpdateDryrunParametersInternal, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParameters __dryrunParameters = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunParameters(); - - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerProperties __linkerProperties = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerProperties(); - - /// The name of action for you dryrun job. - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public string ActionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParametersInternal)__dryrunParameters).ActionName; } - - /// The authentication type. - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase AuthInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).AuthInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).AuthInfo = value ?? null /* model class */; } - - /// The application client type - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType? ClientType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).ClientType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).ClientType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType)""); } - - /// - /// The connection information consumed by applications, including secrets, connection strings. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo ConfigurationInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).ConfigurationInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).ConfigurationInfo = value ?? null /* model class */; } - - /// - /// Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied - /// to the source application. Default is enable. If optOut, no configuration change will be made on source. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? ConfigurationInfoAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).ConfigurationInfoAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).ConfigurationInfoAction = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType)""); } - - /// - /// A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this - /// property is to full fill more customized configurations - /// - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).ConfigurationInfoAdditionalConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).ConfigurationInfoAdditionalConfiguration = value ?? null /* model class */; } - - /// - /// Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be - /// used for generate configurations - /// - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).ConfigurationInfoCustomizedKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).ConfigurationInfoCustomizedKey = value ?? null /* model class */; } - - /// - /// Indicates whether to clean up previous operation when Linker is updating or deleting - /// - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? ConfigurationInfoDeleteOrUpdateBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).ConfigurationInfoDeleteOrUpdateBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).ConfigurationInfoDeleteOrUpdateBehavior = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior)""); } - - /// Allow Azure services to access the target service if true. - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? FirewallRuleAzureService { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).FirewallRuleAzureService; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).FirewallRuleAzureService = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType)""); } - - /// - /// Allow caller client IP to access the target service if true. the property is used when connecting local application to - /// target service. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? FirewallRuleCallerClientIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).FirewallRuleCallerClientIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).FirewallRuleCallerClientIP = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType)""); } - - /// - /// This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client - /// IPs for a given database account. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public string[] FirewallRuleIPRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).FirewallRuleIPRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).FirewallRuleIPRange = value ?? null /* arrayOf */; } - - /// Internal Acessors for ActionName - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParametersInternal.ActionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParametersInternal)__dryrunParameters).ActionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParametersInternal)__dryrunParameters).ActionName = value; } - - /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).ProvisioningState = value; } - - /// The provisioning state. - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).ProvisioningState; } - - /// The network solution. - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolution PublicNetworkSolution { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).PublicNetworkSolution; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).PublicNetworkSolution = value ?? null /* model class */; } - - /// - /// Optional. Indicates public network solution. If enable, enable public network access of target service with best try. - /// Default is enable. If optOut, opt out public network access configuration. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? PublicNetworkSolutionAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).PublicNetworkSolutionAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).PublicNetworkSolutionAction = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType)""); } - - /// - /// Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting - /// - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? PublicNetworkSolutionDeleteOrUpdateBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).PublicNetworkSolutionDeleteOrUpdateBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).PublicNetworkSolutionDeleteOrUpdateBehavior = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior)""); } - - /// - /// Describe firewall rules of target service to make sure source application could connect to the target. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules PublicNetworkSolutionFirewallRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).PublicNetworkSolutionFirewallRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).PublicNetworkSolutionFirewallRule = value ?? null /* model class */; } - - /// connection scope in source service. - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).Scope = value ?? null; } - - /// An option to store secret value in secure place - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStore SecretStore { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).SecretStore; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).SecretStore = value ?? null /* model class */; } - - /// The key vault id to store secret - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public string SecretStoreKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).SecretStoreKeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).SecretStoreKeyVaultId = value ?? null; } - - /// The key vault secret name to store secret, only valid when storing one secret - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public string SecretStoreKeyVaultSecretName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).SecretStoreKeyVaultSecretName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).SecretStoreKeyVaultSecretName = value ?? null; } - - /// The target service properties - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase TargetService { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).TargetService; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).TargetService = value ?? null /* model class */; } - - /// The VNet solution. - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolution VNetSolution { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).VNetSolution; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).VNetSolution = value ?? null /* model class */; } - - /// - /// Indicates whether to clean up previous operation when Linker is updating or deleting - /// - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? VNetSolutionDeleteOrUpdateBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).VNetSolutionDeleteOrUpdateBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).VNetSolutionDeleteOrUpdateBehavior = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior)""); } - - /// Type of VNet solution. - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType? VNetSolutionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).VNetSolutionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)__linkerProperties).VNetSolutionType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType)""); } - - /// Creates an new instance. - public CreateOrUpdateDryrunParameters() - { - - } - - /// 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.ServiceLinker.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__dryrunParameters), __dryrunParameters); - await eventListener.AssertObjectIsValid(nameof(__dryrunParameters), __dryrunParameters); - await eventListener.AssertNotNull(nameof(__linkerProperties), __linkerProperties); - await eventListener.AssertObjectIsValid(nameof(__linkerProperties), __linkerProperties); - } - } - /// The dryrun parameters for creation or update a linker - public partial interface ICreateOrUpdateDryrunParameters : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParameters, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerProperties - { - - } - /// The dryrun parameters for creation or update a linker - internal partial interface ICreateOrUpdateDryrunParametersInternal : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParametersInternal, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal - { - - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunResource.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunResource.PowerShell.cs deleted file mode 100644 index d61b794659d9..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunResource.PowerShell.cs +++ /dev/null @@ -1,266 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; - - /// a dryrun job resource - [System.ComponentModel.TypeConverter(typeof(DryrunResourceTypeConverter))] - public partial class DryrunResource - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should 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.ServiceLinker.Models.Api20221101Preview.IDryrunResource DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new DryrunResource(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new DryrunResource(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal DryrunResource(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.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.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.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.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.ServiceLinker.Models.Api30.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Parameter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParameters) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunParametersTypeConverter.ConvertFrom); - } - if (content.Contains("PrerequisiteResult")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal)this).PrerequisiteResult = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult[]) content.GetValueForProperty("PrerequisiteResult",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal)this).PrerequisiteResult, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunPrerequisiteResultTypeConverter.ConvertFrom)); - } - if (content.Contains("OperationPreview")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal)this).OperationPreview = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview[]) content.GetValueForProperty("OperationPreview",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal)this).OperationPreview, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunOperationPreviewTypeConverter.ConvertFrom)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("ParameterActionName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal)this).ParameterActionName = (string) content.GetValueForProperty("ParameterActionName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal)this).ParameterActionName, global::System.Convert.ToString); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal DryrunResource(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.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.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.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.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.ServiceLinker.Models.Api30.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Parameter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParameters) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunParametersTypeConverter.ConvertFrom); - } - if (content.Contains("PrerequisiteResult")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal)this).PrerequisiteResult = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult[]) content.GetValueForProperty("PrerequisiteResult",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal)this).PrerequisiteResult, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunPrerequisiteResultTypeConverter.ConvertFrom)); - } - if (content.Contains("OperationPreview")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal)this).OperationPreview = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview[]) content.GetValueForProperty("OperationPreview",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal)this).OperationPreview, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunOperationPreviewTypeConverter.ConvertFrom)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("ParameterActionName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal)this).ParameterActionName = (string) content.GetValueForProperty("ParameterActionName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal)this).ParameterActionName, 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.ServiceLinker.Models.Api20221101Preview.IDryrunResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// a dryrun job resource - [System.ComponentModel.TypeConverter(typeof(DryrunResourceTypeConverter))] - public partial interface IDryrunResource - - { - - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunResource.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunResource.cs deleted file mode 100644 index fffa5132995d..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunResource.cs +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; - - /// a dryrun job resource - public partial class DryrunResource : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.Resource(); - - /// - /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Id; } - - /// Internal Acessors for OperationPreview - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview[] Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal.OperationPreview { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).OperationPreview; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).OperationPreview = value; } - - /// Internal Acessors for Parameter - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParameters Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal.Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).Parameter = value; } - - /// Internal Acessors for ParameterActionName - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal.ParameterActionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).ParameterActionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).ParameterActionName = value; } - - /// Internal Acessors for PrerequisiteResult - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult[] Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal.PrerequisiteResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).PrerequisiteResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).PrerequisiteResult = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunProperties Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunProperties()); set { {_property = value;} } } - - /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResourceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).ProvisioningState = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Type = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Name; } - - /// the preview of the operations for creation - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview[] OperationPreview { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).OperationPreview; } - - /// The name of action for you dryrun job. - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string ParameterActionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).ParameterActionName; } - - /// the result of the dryrun - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult[] PrerequisiteResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).PrerequisiteResult; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunProperties _property; - - /// The properties of the dryrun job. - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunProperties()); set => this._property = value; } - - /// The provisioning state. - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).ProvisioningState; } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType)""); } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType)""); } - - /// - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - /// - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Type; } - - /// Creates an new instance. - public DryrunResource() - { - - } - - /// 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.ServiceLinker.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__resource), __resource); - await eventListener.AssertObjectIsValid(nameof(__resource), __resource); - } - } - /// a dryrun job resource - public partial interface IDryrunResource : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResource - { - /// the preview of the operations for creation - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"the preview of the operations for creation", - SerializedName = @"operationPreviews", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview[] OperationPreview { get; } - /// The name of action for you dryrun job. - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The name of action for you dryrun job.", - SerializedName = @"actionName", - PossibleTypes = new [] { typeof(string) })] - string ParameterActionName { get; } - /// the result of the dryrun - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"the result of the dryrun", - SerializedName = @"prerequisiteResults", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult[] PrerequisiteResult { get; } - /// The provisioning state. - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state. ", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(string) })] - string ProvisioningState { get; } - - } - /// a dryrun job resource - internal partial interface IDryrunResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal - { - /// the preview of the operations for creation - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview[] OperationPreview { get; set; } - /// The parameters of the dryrun - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParameters Parameter { get; set; } - /// The name of action for you dryrun job. - string ParameterActionName { get; set; } - /// the result of the dryrun - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult[] PrerequisiteResult { get; set; } - /// The properties of the dryrun job. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunProperties Property { get; set; } - /// The provisioning state. - string ProvisioningState { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerPatch.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerPatch.PowerShell.cs deleted file mode 100644 index 769787ba4fee..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerPatch.PowerShell.cs +++ /dev/null @@ -1,328 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; - - /// A Linker to be updated. - [System.ComponentModel.TypeConverter(typeof(LinkerPatchTypeConverter))] - public partial class LinkerPatch - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should 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.ServiceLinker.Models.Api20221101Preview.ILinkerPatch DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new LinkerPatch(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new LinkerPatch(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal LinkerPatch(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.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SecretStore")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).SecretStore = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStore) content.GetValueForProperty("SecretStore",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).SecretStore, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretStoreTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ConfigurationInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo) content.GetValueForProperty("ConfigurationInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ConfigurationInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("ClientType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ClientType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType?) content.GetValueForProperty("ClientType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ClientType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType.CreateFrom); - } - if (content.Contains("VNetSolution")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).VNetSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolution) content.GetValueForProperty("VNetSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).VNetSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.VNetSolutionTypeConverter.ConvertFrom); - } - if (content.Contains("PublicNetworkSolution")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).PublicNetworkSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolution) content.GetValueForProperty("PublicNetworkSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).PublicNetworkSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.PublicNetworkSolutionTypeConverter.ConvertFrom); - } - if (content.Contains("TargetService")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).TargetService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase) content.GetValueForProperty("TargetService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).TargetService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.TargetServiceBaseTypeConverter.ConvertFrom); - } - if (content.Contains("AuthInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).AuthInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase) content.GetValueForProperty("AuthInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).AuthInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AuthInfoBaseTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("VNetSolutionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).VNetSolutionType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType?) content.GetValueForProperty("VNetSolutionType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).VNetSolutionType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType.CreateFrom); - } - if (content.Contains("PublicNetworkSolutionFirewallRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).PublicNetworkSolutionFirewallRule = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules) content.GetValueForProperty("PublicNetworkSolutionFirewallRule",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).PublicNetworkSolutionFirewallRule, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.FirewallRulesTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationInfoCustomizedKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ConfigurationInfoCustomizedKey = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys) content.GetValueForProperty("ConfigurationInfoCustomizedKey",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ConfigurationInfoCustomizedKey, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoCustomizedKeysTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationInfoAdditionalConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ConfigurationInfoAdditionalConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations) content.GetValueForProperty("ConfigurationInfoAdditionalConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ConfigurationInfoAdditionalConfiguration, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoAdditionalConfigurationsTypeConverter.ConvertFrom); - } - if (content.Contains("VNetSolutionDeleteOrUpdateBehavior")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).VNetSolutionDeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("VNetSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).VNetSolutionDeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); - } - if (content.Contains("SecretStoreKeyVaultId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).SecretStoreKeyVaultId = (string) content.GetValueForProperty("SecretStoreKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).SecretStoreKeyVaultId, global::System.Convert.ToString); - } - if (content.Contains("SecretStoreKeyVaultSecretName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).SecretStoreKeyVaultSecretName = (string) content.GetValueForProperty("SecretStoreKeyVaultSecretName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).SecretStoreKeyVaultSecretName, global::System.Convert.ToString); - } - if (content.Contains("PublicNetworkSolutionDeleteOrUpdateBehavior")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("PublicNetworkSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); - } - if (content.Contains("PublicNetworkSolutionAction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).PublicNetworkSolutionAction = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType?) content.GetValueForProperty("PublicNetworkSolutionAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).PublicNetworkSolutionAction, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType.CreateFrom); - } - if (content.Contains("FirewallRuleIPRange")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).FirewallRuleIPRange = (string[]) content.GetValueForProperty("FirewallRuleIPRange",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).FirewallRuleIPRange, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ConfigurationInfoDeleteOrUpdateBehavior")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ConfigurationInfoDeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("ConfigurationInfoDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ConfigurationInfoDeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); - } - if (content.Contains("ConfigurationInfoAction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ConfigurationInfoAction = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType?) content.GetValueForProperty("ConfigurationInfoAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ConfigurationInfoAction, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType.CreateFrom); - } - if (content.Contains("FirewallRuleAzureService")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).FirewallRuleAzureService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType?) content.GetValueForProperty("FirewallRuleAzureService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).FirewallRuleAzureService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType.CreateFrom); - } - if (content.Contains("FirewallRuleCallerClientIP")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).FirewallRuleCallerClientIP = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType?) content.GetValueForProperty("FirewallRuleCallerClientIP",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).FirewallRuleCallerClientIP, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType.CreateFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal LinkerPatch(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.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SecretStore")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).SecretStore = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStore) content.GetValueForProperty("SecretStore",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).SecretStore, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretStoreTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ConfigurationInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo) content.GetValueForProperty("ConfigurationInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ConfigurationInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("ClientType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ClientType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType?) content.GetValueForProperty("ClientType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ClientType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType.CreateFrom); - } - if (content.Contains("VNetSolution")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).VNetSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolution) content.GetValueForProperty("VNetSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).VNetSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.VNetSolutionTypeConverter.ConvertFrom); - } - if (content.Contains("PublicNetworkSolution")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).PublicNetworkSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolution) content.GetValueForProperty("PublicNetworkSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).PublicNetworkSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.PublicNetworkSolutionTypeConverter.ConvertFrom); - } - if (content.Contains("TargetService")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).TargetService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase) content.GetValueForProperty("TargetService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).TargetService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.TargetServiceBaseTypeConverter.ConvertFrom); - } - if (content.Contains("AuthInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).AuthInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase) content.GetValueForProperty("AuthInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).AuthInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AuthInfoBaseTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("VNetSolutionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).VNetSolutionType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType?) content.GetValueForProperty("VNetSolutionType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).VNetSolutionType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType.CreateFrom); - } - if (content.Contains("PublicNetworkSolutionFirewallRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).PublicNetworkSolutionFirewallRule = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules) content.GetValueForProperty("PublicNetworkSolutionFirewallRule",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).PublicNetworkSolutionFirewallRule, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.FirewallRulesTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationInfoCustomizedKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ConfigurationInfoCustomizedKey = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys) content.GetValueForProperty("ConfigurationInfoCustomizedKey",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ConfigurationInfoCustomizedKey, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoCustomizedKeysTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationInfoAdditionalConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ConfigurationInfoAdditionalConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations) content.GetValueForProperty("ConfigurationInfoAdditionalConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ConfigurationInfoAdditionalConfiguration, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoAdditionalConfigurationsTypeConverter.ConvertFrom); - } - if (content.Contains("VNetSolutionDeleteOrUpdateBehavior")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).VNetSolutionDeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("VNetSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).VNetSolutionDeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); - } - if (content.Contains("SecretStoreKeyVaultId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).SecretStoreKeyVaultId = (string) content.GetValueForProperty("SecretStoreKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).SecretStoreKeyVaultId, global::System.Convert.ToString); - } - if (content.Contains("SecretStoreKeyVaultSecretName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).SecretStoreKeyVaultSecretName = (string) content.GetValueForProperty("SecretStoreKeyVaultSecretName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).SecretStoreKeyVaultSecretName, global::System.Convert.ToString); - } - if (content.Contains("PublicNetworkSolutionDeleteOrUpdateBehavior")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("PublicNetworkSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); - } - if (content.Contains("PublicNetworkSolutionAction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).PublicNetworkSolutionAction = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType?) content.GetValueForProperty("PublicNetworkSolutionAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).PublicNetworkSolutionAction, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType.CreateFrom); - } - if (content.Contains("FirewallRuleIPRange")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).FirewallRuleIPRange = (string[]) content.GetValueForProperty("FirewallRuleIPRange",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).FirewallRuleIPRange, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ConfigurationInfoDeleteOrUpdateBehavior")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ConfigurationInfoDeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("ConfigurationInfoDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ConfigurationInfoDeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); - } - if (content.Contains("ConfigurationInfoAction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ConfigurationInfoAction = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType?) content.GetValueForProperty("ConfigurationInfoAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).ConfigurationInfoAction, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType.CreateFrom); - } - if (content.Contains("FirewallRuleAzureService")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).FirewallRuleAzureService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType?) content.GetValueForProperty("FirewallRuleAzureService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).FirewallRuleAzureService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType.CreateFrom); - } - if (content.Contains("FirewallRuleCallerClientIP")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).FirewallRuleCallerClientIP = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType?) content.GetValueForProperty("FirewallRuleCallerClientIP",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal)this).FirewallRuleCallerClientIP, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType.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.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// A Linker to be updated. - [System.ComponentModel.TypeConverter(typeof(LinkerPatchTypeConverter))] - public partial interface ILinkerPatch - - { - - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerProperties.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerProperties.PowerShell.cs deleted file mode 100644 index 78516384b1e7..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerProperties.PowerShell.cs +++ /dev/null @@ -1,322 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; - - /// The properties of the Linker. - [System.ComponentModel.TypeConverter(typeof(LinkerPropertiesTypeConverter))] - public partial class LinkerProperties - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should 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.ServiceLinker.Models.Api20221101Preview.ILinkerProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new LinkerProperties(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new LinkerProperties(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal LinkerProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("VNetSolution")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).VNetSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolution) content.GetValueForProperty("VNetSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).VNetSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.VNetSolutionTypeConverter.ConvertFrom); - } - if (content.Contains("SecretStore")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).SecretStore = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStore) content.GetValueForProperty("SecretStore",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).SecretStore, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretStoreTypeConverter.ConvertFrom); - } - if (content.Contains("PublicNetworkSolution")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolution) content.GetValueForProperty("PublicNetworkSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.PublicNetworkSolutionTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo) content.GetValueForProperty("ConfigurationInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("TargetService")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).TargetService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase) content.GetValueForProperty("TargetService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).TargetService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.TargetServiceBaseTypeConverter.ConvertFrom); - } - if (content.Contains("AuthInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).AuthInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase) content.GetValueForProperty("AuthInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).AuthInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AuthInfoBaseTypeConverter.ConvertFrom); - } - if (content.Contains("ClientType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ClientType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType?) content.GetValueForProperty("ClientType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ClientType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType.CreateFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("VNetSolutionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).VNetSolutionType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType?) content.GetValueForProperty("VNetSolutionType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).VNetSolutionType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType.CreateFrom); - } - if (content.Contains("PublicNetworkSolutionFirewallRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolutionFirewallRule = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules) content.GetValueForProperty("PublicNetworkSolutionFirewallRule",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolutionFirewallRule, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.FirewallRulesTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationInfoCustomizedKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoCustomizedKey = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys) content.GetValueForProperty("ConfigurationInfoCustomizedKey",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoCustomizedKey, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoCustomizedKeysTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationInfoAdditionalConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoAdditionalConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations) content.GetValueForProperty("ConfigurationInfoAdditionalConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoAdditionalConfiguration, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoAdditionalConfigurationsTypeConverter.ConvertFrom); - } - if (content.Contains("VNetSolutionDeleteOrUpdateBehavior")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).VNetSolutionDeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("VNetSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).VNetSolutionDeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); - } - if (content.Contains("SecretStoreKeyVaultId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).SecretStoreKeyVaultId = (string) content.GetValueForProperty("SecretStoreKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).SecretStoreKeyVaultId, global::System.Convert.ToString); - } - if (content.Contains("SecretStoreKeyVaultSecretName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).SecretStoreKeyVaultSecretName = (string) content.GetValueForProperty("SecretStoreKeyVaultSecretName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).SecretStoreKeyVaultSecretName, global::System.Convert.ToString); - } - if (content.Contains("PublicNetworkSolutionDeleteOrUpdateBehavior")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("PublicNetworkSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); - } - if (content.Contains("PublicNetworkSolutionAction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolutionAction = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType?) content.GetValueForProperty("PublicNetworkSolutionAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolutionAction, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType.CreateFrom); - } - if (content.Contains("FirewallRuleIPRange")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).FirewallRuleIPRange = (string[]) content.GetValueForProperty("FirewallRuleIPRange",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).FirewallRuleIPRange, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ConfigurationInfoDeleteOrUpdateBehavior")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoDeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("ConfigurationInfoDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoDeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); - } - if (content.Contains("ConfigurationInfoAction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoAction = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType?) content.GetValueForProperty("ConfigurationInfoAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoAction, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType.CreateFrom); - } - if (content.Contains("FirewallRuleAzureService")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).FirewallRuleAzureService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType?) content.GetValueForProperty("FirewallRuleAzureService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).FirewallRuleAzureService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType.CreateFrom); - } - if (content.Contains("FirewallRuleCallerClientIP")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).FirewallRuleCallerClientIP = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType?) content.GetValueForProperty("FirewallRuleCallerClientIP",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).FirewallRuleCallerClientIP, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType.CreateFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal LinkerProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("VNetSolution")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).VNetSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolution) content.GetValueForProperty("VNetSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).VNetSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.VNetSolutionTypeConverter.ConvertFrom); - } - if (content.Contains("SecretStore")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).SecretStore = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStore) content.GetValueForProperty("SecretStore",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).SecretStore, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretStoreTypeConverter.ConvertFrom); - } - if (content.Contains("PublicNetworkSolution")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolution) content.GetValueForProperty("PublicNetworkSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.PublicNetworkSolutionTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo) content.GetValueForProperty("ConfigurationInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("TargetService")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).TargetService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase) content.GetValueForProperty("TargetService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).TargetService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.TargetServiceBaseTypeConverter.ConvertFrom); - } - if (content.Contains("AuthInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).AuthInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase) content.GetValueForProperty("AuthInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).AuthInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AuthInfoBaseTypeConverter.ConvertFrom); - } - if (content.Contains("ClientType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ClientType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType?) content.GetValueForProperty("ClientType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ClientType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType.CreateFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("VNetSolutionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).VNetSolutionType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType?) content.GetValueForProperty("VNetSolutionType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).VNetSolutionType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType.CreateFrom); - } - if (content.Contains("PublicNetworkSolutionFirewallRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolutionFirewallRule = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules) content.GetValueForProperty("PublicNetworkSolutionFirewallRule",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolutionFirewallRule, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.FirewallRulesTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationInfoCustomizedKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoCustomizedKey = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys) content.GetValueForProperty("ConfigurationInfoCustomizedKey",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoCustomizedKey, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoCustomizedKeysTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationInfoAdditionalConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoAdditionalConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations) content.GetValueForProperty("ConfigurationInfoAdditionalConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoAdditionalConfiguration, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoAdditionalConfigurationsTypeConverter.ConvertFrom); - } - if (content.Contains("VNetSolutionDeleteOrUpdateBehavior")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).VNetSolutionDeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("VNetSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).VNetSolutionDeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); - } - if (content.Contains("SecretStoreKeyVaultId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).SecretStoreKeyVaultId = (string) content.GetValueForProperty("SecretStoreKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).SecretStoreKeyVaultId, global::System.Convert.ToString); - } - if (content.Contains("SecretStoreKeyVaultSecretName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).SecretStoreKeyVaultSecretName = (string) content.GetValueForProperty("SecretStoreKeyVaultSecretName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).SecretStoreKeyVaultSecretName, global::System.Convert.ToString); - } - if (content.Contains("PublicNetworkSolutionDeleteOrUpdateBehavior")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("PublicNetworkSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); - } - if (content.Contains("PublicNetworkSolutionAction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolutionAction = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType?) content.GetValueForProperty("PublicNetworkSolutionAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).PublicNetworkSolutionAction, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType.CreateFrom); - } - if (content.Contains("FirewallRuleIPRange")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).FirewallRuleIPRange = (string[]) content.GetValueForProperty("FirewallRuleIPRange",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).FirewallRuleIPRange, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ConfigurationInfoDeleteOrUpdateBehavior")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoDeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("ConfigurationInfoDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoDeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); - } - if (content.Contains("ConfigurationInfoAction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoAction = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType?) content.GetValueForProperty("ConfigurationInfoAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).ConfigurationInfoAction, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType.CreateFrom); - } - if (content.Contains("FirewallRuleAzureService")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).FirewallRuleAzureService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType?) content.GetValueForProperty("FirewallRuleAzureService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).FirewallRuleAzureService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType.CreateFrom); - } - if (content.Contains("FirewallRuleCallerClientIP")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).FirewallRuleCallerClientIP = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType?) content.GetValueForProperty("FirewallRuleCallerClientIP",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)this).FirewallRuleCallerClientIP, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType.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.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// The properties of the Linker. - [System.ComponentModel.TypeConverter(typeof(LinkerPropertiesTypeConverter))] - public partial interface ILinkerProperties - - { - - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerResource.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerResource.PowerShell.cs deleted file mode 100644 index a72a4e02dad1..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerResource.PowerShell.cs +++ /dev/null @@ -1,410 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; - - /// Linker of source and target resource - [System.ComponentModel.TypeConverter(typeof(LinkerResourceTypeConverter))] - public partial class LinkerResource - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should 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.ServiceLinker.Models.Api20221101Preview.ILinkerResource DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new LinkerResource(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new LinkerResource(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal LinkerResource(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.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.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.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.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.ServiceLinker.Models.Api30.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("SecretStore")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).SecretStore = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStore) content.GetValueForProperty("SecretStore",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).SecretStore, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretStoreTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ConfigurationInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo) content.GetValueForProperty("ConfigurationInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ConfigurationInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("ClientType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ClientType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType?) content.GetValueForProperty("ClientType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ClientType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType.CreateFrom); - } - if (content.Contains("VNetSolution")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).VNetSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolution) content.GetValueForProperty("VNetSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).VNetSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.VNetSolutionTypeConverter.ConvertFrom); - } - if (content.Contains("PublicNetworkSolution")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).PublicNetworkSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolution) content.GetValueForProperty("PublicNetworkSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).PublicNetworkSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.PublicNetworkSolutionTypeConverter.ConvertFrom); - } - if (content.Contains("TargetService")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).TargetService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase) content.GetValueForProperty("TargetService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).TargetService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.TargetServiceBaseTypeConverter.ConvertFrom); - } - if (content.Contains("AuthInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).AuthInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase) content.GetValueForProperty("AuthInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).AuthInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AuthInfoBaseTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("VNetSolutionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).VNetSolutionType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType?) content.GetValueForProperty("VNetSolutionType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).VNetSolutionType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType.CreateFrom); - } - if (content.Contains("PublicNetworkSolutionFirewallRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).PublicNetworkSolutionFirewallRule = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules) content.GetValueForProperty("PublicNetworkSolutionFirewallRule",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).PublicNetworkSolutionFirewallRule, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.FirewallRulesTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationInfoCustomizedKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ConfigurationInfoCustomizedKey = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys) content.GetValueForProperty("ConfigurationInfoCustomizedKey",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ConfigurationInfoCustomizedKey, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoCustomizedKeysTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationInfoAdditionalConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ConfigurationInfoAdditionalConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations) content.GetValueForProperty("ConfigurationInfoAdditionalConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ConfigurationInfoAdditionalConfiguration, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoAdditionalConfigurationsTypeConverter.ConvertFrom); - } - if (content.Contains("VNetSolutionDeleteOrUpdateBehavior")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).VNetSolutionDeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("VNetSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).VNetSolutionDeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); - } - if (content.Contains("SecretStoreKeyVaultId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).SecretStoreKeyVaultId = (string) content.GetValueForProperty("SecretStoreKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).SecretStoreKeyVaultId, global::System.Convert.ToString); - } - if (content.Contains("SecretStoreKeyVaultSecretName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).SecretStoreKeyVaultSecretName = (string) content.GetValueForProperty("SecretStoreKeyVaultSecretName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).SecretStoreKeyVaultSecretName, global::System.Convert.ToString); - } - if (content.Contains("PublicNetworkSolutionDeleteOrUpdateBehavior")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("PublicNetworkSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); - } - if (content.Contains("PublicNetworkSolutionAction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).PublicNetworkSolutionAction = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType?) content.GetValueForProperty("PublicNetworkSolutionAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).PublicNetworkSolutionAction, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType.CreateFrom); - } - if (content.Contains("FirewallRuleIPRange")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).FirewallRuleIPRange = (string[]) content.GetValueForProperty("FirewallRuleIPRange",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).FirewallRuleIPRange, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ConfigurationInfoDeleteOrUpdateBehavior")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ConfigurationInfoDeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("ConfigurationInfoDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ConfigurationInfoDeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); - } - if (content.Contains("ConfigurationInfoAction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ConfigurationInfoAction = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType?) content.GetValueForProperty("ConfigurationInfoAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ConfigurationInfoAction, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType.CreateFrom); - } - if (content.Contains("FirewallRuleAzureService")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).FirewallRuleAzureService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType?) content.GetValueForProperty("FirewallRuleAzureService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).FirewallRuleAzureService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType.CreateFrom); - } - if (content.Contains("FirewallRuleCallerClientIP")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).FirewallRuleCallerClientIP = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType?) content.GetValueForProperty("FirewallRuleCallerClientIP",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).FirewallRuleCallerClientIP, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType.CreateFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal LinkerResource(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.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.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.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.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.ServiceLinker.Models.Api30.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("SecretStore")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).SecretStore = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStore) content.GetValueForProperty("SecretStore",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).SecretStore, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretStoreTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ConfigurationInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo) content.GetValueForProperty("ConfigurationInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ConfigurationInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoTypeConverter.ConvertFrom); - } - if (content.Contains("ClientType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ClientType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType?) content.GetValueForProperty("ClientType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ClientType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType.CreateFrom); - } - if (content.Contains("VNetSolution")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).VNetSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolution) content.GetValueForProperty("VNetSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).VNetSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.VNetSolutionTypeConverter.ConvertFrom); - } - if (content.Contains("PublicNetworkSolution")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).PublicNetworkSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolution) content.GetValueForProperty("PublicNetworkSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).PublicNetworkSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.PublicNetworkSolutionTypeConverter.ConvertFrom); - } - if (content.Contains("TargetService")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).TargetService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase) content.GetValueForProperty("TargetService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).TargetService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.TargetServiceBaseTypeConverter.ConvertFrom); - } - if (content.Contains("AuthInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).AuthInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase) content.GetValueForProperty("AuthInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).AuthInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AuthInfoBaseTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("VNetSolutionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).VNetSolutionType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType?) content.GetValueForProperty("VNetSolutionType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).VNetSolutionType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType.CreateFrom); - } - if (content.Contains("PublicNetworkSolutionFirewallRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).PublicNetworkSolutionFirewallRule = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules) content.GetValueForProperty("PublicNetworkSolutionFirewallRule",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).PublicNetworkSolutionFirewallRule, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.FirewallRulesTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationInfoCustomizedKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ConfigurationInfoCustomizedKey = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys) content.GetValueForProperty("ConfigurationInfoCustomizedKey",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ConfigurationInfoCustomizedKey, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoCustomizedKeysTypeConverter.ConvertFrom); - } - if (content.Contains("ConfigurationInfoAdditionalConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ConfigurationInfoAdditionalConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations) content.GetValueForProperty("ConfigurationInfoAdditionalConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ConfigurationInfoAdditionalConfiguration, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoAdditionalConfigurationsTypeConverter.ConvertFrom); - } - if (content.Contains("VNetSolutionDeleteOrUpdateBehavior")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).VNetSolutionDeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("VNetSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).VNetSolutionDeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); - } - if (content.Contains("SecretStoreKeyVaultId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).SecretStoreKeyVaultId = (string) content.GetValueForProperty("SecretStoreKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).SecretStoreKeyVaultId, global::System.Convert.ToString); - } - if (content.Contains("SecretStoreKeyVaultSecretName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).SecretStoreKeyVaultSecretName = (string) content.GetValueForProperty("SecretStoreKeyVaultSecretName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).SecretStoreKeyVaultSecretName, global::System.Convert.ToString); - } - if (content.Contains("PublicNetworkSolutionDeleteOrUpdateBehavior")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("PublicNetworkSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); - } - if (content.Contains("PublicNetworkSolutionAction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).PublicNetworkSolutionAction = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType?) content.GetValueForProperty("PublicNetworkSolutionAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).PublicNetworkSolutionAction, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType.CreateFrom); - } - if (content.Contains("FirewallRuleIPRange")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).FirewallRuleIPRange = (string[]) content.GetValueForProperty("FirewallRuleIPRange",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).FirewallRuleIPRange, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ConfigurationInfoDeleteOrUpdateBehavior")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ConfigurationInfoDeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("ConfigurationInfoDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ConfigurationInfoDeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); - } - if (content.Contains("ConfigurationInfoAction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ConfigurationInfoAction = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType?) content.GetValueForProperty("ConfigurationInfoAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).ConfigurationInfoAction, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType.CreateFrom); - } - if (content.Contains("FirewallRuleAzureService")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).FirewallRuleAzureService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType?) content.GetValueForProperty("FirewallRuleAzureService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).FirewallRuleAzureService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType.CreateFrom); - } - if (content.Contains("FirewallRuleCallerClientIP")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).FirewallRuleCallerClientIP = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType?) content.GetValueForProperty("FirewallRuleCallerClientIP",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal)this).FirewallRuleCallerClientIP, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType.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.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Linker of source and target resource - [System.ComponentModel.TypeConverter(typeof(LinkerResourceTypeConverter))] - public partial interface ILinkerResource - - { - - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AuthInfoBase.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AuthInfoBase.PowerShell.cs similarity index 77% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AuthInfoBase.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AuthInfoBase.PowerShell.cs index 6c6a7aeaad2f..3396214cf166 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AuthInfoBase.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AuthInfoBase.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class AuthInfoBase partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -70,13 +78,13 @@ internal AuthInfoBase(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("AuthType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType = (string) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -91,33 +99,33 @@ internal AuthInfoBase(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("AuthType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType = (string) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AuthInfoBase(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AuthInfoBase(content); } @@ -127,12 +135,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The authentication info [System.ComponentModel.TypeConverter(typeof(AuthInfoBaseTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AuthInfoBase.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AuthInfoBase.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AuthInfoBase.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AuthInfoBase.TypeConverter.cs index daa19eca4867..b8a940734044 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AuthInfoBase.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AuthInfoBase.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AuthInfoBase.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AuthInfoBase.cs similarity index 66% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AuthInfoBase.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AuthInfoBase.cs index ba1d3a29b322..4f88b7c7df4e 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AuthInfoBase.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AuthInfoBase.cs @@ -3,22 +3,22 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The authentication info public partial class AuthInfoBase : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType _authType; + private string _authType; /// The authentication type. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType AuthType { get => this._authType; set => this._authType = value; } + public string AuthType { get => this._authType; set => this._authType = value; } /// Creates an new instance. public AuthInfoBase() @@ -34,10 +34,14 @@ public partial interface IAuthInfoBase : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The authentication type.", SerializedName = @"authType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType AuthType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("systemAssignedIdentity", "userAssignedIdentity", "servicePrincipalSecret", "servicePrincipalCertificate", "secret", "accessKey", "userAccount")] + string AuthType { get; set; } } /// The authentication info @@ -45,7 +49,8 @@ internal partial interface IAuthInfoBaseInternal { /// The authentication type. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType AuthType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("systemAssignedIdentity", "userAssignedIdentity", "servicePrincipalSecret", "servicePrincipalCertificate", "secret", "accessKey", "userAccount")] + string AuthType { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AuthInfoBase.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AuthInfoBase.json.cs similarity index 93% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AuthInfoBase.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AuthInfoBase.json.cs index 0f743254b1bb..9540a64eb0c0 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AuthInfoBase.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AuthInfoBase.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -65,20 +65,20 @@ internal AuthInfoBase(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.J { return; } - {_authType = If( json?.PropertyT("authType"), out var __jsonAuthType) ? (string)__jsonAuthType : (string)AuthType;} + {_authType = If( json?.PropertyT("authType"), out var __jsonAuthType) ? (string)__jsonAuthType : (string)_authType;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase. - /// Note: the Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase interface is polymorphic, - /// and the precise model class that will get deserialized is determined at runtime based on the payload. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase interface is polymorphic, and the precise + /// model class that will get deserialized is determined at runtime based on the payload. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { if (!(node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json)) { diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureKeyVaultProperties.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureKeyVaultProperties.PowerShell.cs similarity index 72% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureKeyVaultProperties.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureKeyVaultProperties.PowerShell.cs index 14d449e1e709..a8d464b3f958 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureKeyVaultProperties.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureKeyVaultProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class AzureKeyVaultProperties partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -70,17 +78,17 @@ internal AzureKeyVaultProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("ConnectAsKubernetesCsiDriver")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureKeyVaultPropertiesInternal)this).ConnectAsKubernetesCsiDriver = (bool?) content.GetValueForProperty("ConnectAsKubernetesCsiDriver",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureKeyVaultPropertiesInternal)this).ConnectAsKubernetesCsiDriver, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureKeyVaultPropertiesInternal)this).ConnectAsKubernetesCsiDriver = (bool?) content.GetValueForProperty("ConnectAsKubernetesCsiDriver",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureKeyVaultPropertiesInternal)this).ConnectAsKubernetesCsiDriver, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBaseInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBaseInternal)this).Type, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -95,39 +103,37 @@ internal AzureKeyVaultProperties(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("ConnectAsKubernetesCsiDriver")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureKeyVaultPropertiesInternal)this).ConnectAsKubernetesCsiDriver = (bool?) content.GetValueForProperty("ConnectAsKubernetesCsiDriver",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureKeyVaultPropertiesInternal)this).ConnectAsKubernetesCsiDriver, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureKeyVaultPropertiesInternal)this).ConnectAsKubernetesCsiDriver = (bool?) content.GetValueForProperty("ConnectAsKubernetesCsiDriver",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureKeyVaultPropertiesInternal)this).ConnectAsKubernetesCsiDriver, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBaseInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBaseInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureKeyVaultProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureKeyVaultProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AzureKeyVaultProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureKeyVaultProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureKeyVaultProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AzureKeyVaultProperties(content); } @@ -137,12 +143,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureKeyVaultProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureKeyVaultProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The resource properties when type is Azure Key Vault [System.ComponentModel.TypeConverter(typeof(AzureKeyVaultPropertiesTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureKeyVaultProperties.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureKeyVaultProperties.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureKeyVaultProperties.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureKeyVaultProperties.TypeConverter.cs index 589c8529738f..f6ae6a0ed1e8 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureKeyVaultProperties.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureKeyVaultProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureKeyVaultProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureKeyVaultProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureKeyVaultProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureKeyVaultProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureKeyVaultProperties.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureKeyVaultProperties.cs similarity index 77% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureKeyVaultProperties.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureKeyVaultProperties.cs index 276f924f534a..b6824db83ad4 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureKeyVaultProperties.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureKeyVaultProperties.cs @@ -3,21 +3,21 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The resource properties when type is Azure Key Vault public partial class AzureKeyVaultProperties : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureKeyVaultProperties, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureKeyVaultPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureKeyVaultProperties, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureKeyVaultPropertiesInternal, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBase __azureResourcePropertiesBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AzureResourcePropertiesBase(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBase __azureResourcePropertiesBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AzureResourcePropertiesBase(); /// Backing field for property. private bool? _connectAsKubernetesCsiDriver; @@ -27,11 +27,12 @@ public partial class AzureKeyVaultProperties : public bool? ConnectAsKubernetesCsiDriver { get => this._connectAsKubernetesCsiDriver; set => this._connectAsKubernetesCsiDriver = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBaseInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBaseInternal)__azureResourcePropertiesBase).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBaseInternal)__azureResourcePropertiesBase).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBaseInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBaseInternal)__azureResourcePropertiesBase).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBaseInternal)__azureResourcePropertiesBase).Type = value ; } /// The azure resource type. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Constant] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBaseInternal)__azureResourcePropertiesBase).Type; } + public string Type { get => "KeyVault"; } /// Creates an new instance. public AzureKeyVaultProperties() @@ -54,12 +55,15 @@ public AzureKeyVaultProperties() /// The resource properties when type is Azure Key Vault public partial interface IAzureKeyVaultProperties : Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBase + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBase { /// True if connect via Kubernetes CSI Driver. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"True if connect via Kubernetes CSI Driver.", SerializedName = @"connectAsKubernetesCsiDriver", PossibleTypes = new [] { typeof(bool) })] @@ -68,7 +72,7 @@ public partial interface IAzureKeyVaultProperties : } /// The resource properties when type is Azure Key Vault internal partial interface IAzureKeyVaultPropertiesInternal : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBaseInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBaseInternal { /// True if connect via Kubernetes CSI Driver. bool? ConnectAsKubernetesCsiDriver { get; set; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureKeyVaultProperties.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureKeyVaultProperties.json.cs similarity index 93% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureKeyVaultProperties.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureKeyVaultProperties.json.cs index 04eca9d7fb0c..4ed70c4a71b0 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureKeyVaultProperties.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureKeyVaultProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -65,19 +65,19 @@ internal AzureKeyVaultProperties(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinke { return; } - __azureResourcePropertiesBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AzureResourcePropertiesBase(json); - {_connectAsKubernetesCsiDriver = If( json?.PropertyT("connectAsKubernetesCsiDriver"), out var __jsonConnectAsKubernetesCsiDriver) ? (bool?)__jsonConnectAsKubernetesCsiDriver : ConnectAsKubernetesCsiDriver;} + __azureResourcePropertiesBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AzureResourcePropertiesBase(json); + {_connectAsKubernetesCsiDriver = If( json?.PropertyT("connectAsKubernetesCsiDriver"), out var __jsonConnectAsKubernetesCsiDriver) ? (bool?)__jsonConnectAsKubernetesCsiDriver : _connectAsKubernetesCsiDriver;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureKeyVaultProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureKeyVaultProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureKeyVaultProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureKeyVaultProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureKeyVaultProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureKeyVaultProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new AzureKeyVaultProperties(json) : null; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureResource.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureResource.PowerShell.cs similarity index 70% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureResource.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureResource.PowerShell.cs index 6377091c7842..849b5525b0ad 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureResource.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureResource.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class AzureResource partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -70,21 +78,21 @@ internal AzureResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("ResourceProperty")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourceInternal)this).ResourceProperty = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBase) content.GetValueForProperty("ResourceProperty",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourceInternal)this).ResourceProperty, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AzureResourcePropertiesBaseTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourceInternal)this).ResourceProperty = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBase) content.GetValueForProperty("ResourceProperty",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourceInternal)this).ResourceProperty, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AzureResourcePropertiesBaseTypeConverter.ConvertFrom); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal)this).Type, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -99,41 +107,41 @@ internal AzureResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("ResourceProperty")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourceInternal)this).ResourceProperty = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBase) content.GetValueForProperty("ResourceProperty",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourceInternal)this).ResourceProperty, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AzureResourcePropertiesBaseTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourceInternal)this).ResourceProperty = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBase) content.GetValueForProperty("ResourceProperty",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourceInternal)this).ResourceProperty, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AzureResourcePropertiesBaseTypeConverter.ConvertFrom); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AzureResource(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AzureResource(content); } @@ -143,12 +151,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The azure resource info when target service type is AzureResource [System.ComponentModel.TypeConverter(typeof(AzureResourceTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureResource.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureResource.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureResource.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureResource.TypeConverter.cs index 797cd2476829..733735870915 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureResource.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureResource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureResource.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureResource.cs similarity index 75% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureResource.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureResource.cs index 695cc29bd18f..25cf223d80b6 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureResource.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureResource.cs @@ -3,21 +3,21 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The azure resource info when target service type is AzureResource public partial class AzureResource : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResource, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResource, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase __targetServiceBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.TargetServiceBase(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase __targetServiceBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.TargetServiceBase(); /// Backing field for property. private string _id; @@ -27,20 +27,21 @@ public partial class AzureResource : public string Id { get => this._id; set => this._id = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBase _resourceProperty; + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBase _resourceProperty; /// The azure resource connection related properties. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBase ResourceProperty { get => (this._resourceProperty = this._resourceProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AzureResourcePropertiesBase()); set => this._resourceProperty = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBase ResourceProperty { get => (this._resourceProperty = this._resourceProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AzureResourcePropertiesBase()); set => this._resourceProperty = value; } /// The target service type. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Constant] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)__targetServiceBase).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)__targetServiceBase).Type = value ; } + public string Type { get => "AzureResource"; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal)__targetServiceBase).Type = "AzureResource"; } /// Creates an new instance. public AzureResource() { - + this.__targetServiceBase.Type = "AzureResource"; } /// Validates that this object meets the validation criteria. @@ -58,12 +59,15 @@ public AzureResource() /// The azure resource info when target service type is AzureResource public partial interface IAzureResource : Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase { /// The Id of azure resource. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Id of azure resource.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -72,20 +76,23 @@ public partial interface IAzureResource : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The azure resource connection related properties.", SerializedName = @"resourceProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBase) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBase ResourceProperty { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBase) })] + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBase ResourceProperty { get; set; } } /// The azure resource info when target service type is AzureResource internal partial interface IAzureResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal { /// The Id of azure resource. string Id { get; set; } /// The azure resource connection related properties. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBase ResourceProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBase ResourceProperty { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureResource.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureResource.json.cs similarity index 92% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureResource.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureResource.json.cs index 610a6d2b96d7..7c027964e18d 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureResource.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureResource.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -65,20 +65,20 @@ internal AzureResource(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime. { return; } - __targetServiceBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.TargetServiceBase(json); - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_resourceProperty = If( json?.PropertyT("resourceProperties"), out var __jsonResourceProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AzureResourcePropertiesBase.FromJson(__jsonResourceProperties) : ResourceProperty;} + __targetServiceBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.TargetServiceBase(json); + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_resourceProperty = If( json?.PropertyT("resourceProperties"), out var __jsonResourceProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AzureResourcePropertiesBase.FromJson(__jsonResourceProperties) : _resourceProperty;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new AzureResource(json) : null; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureResourcePropertiesBase.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureResourcePropertiesBase.PowerShell.cs similarity index 76% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureResourcePropertiesBase.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureResourcePropertiesBase.PowerShell.cs index 5735e79a024b..79c4d0114215 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureResourcePropertiesBase.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureResourcePropertiesBase.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class AzureResourcePropertiesBase partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -70,13 +78,13 @@ internal AzureResourcePropertiesBase(global::System.Collections.IDictionary cont // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBaseInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBaseInternal)this).Type, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -91,35 +99,33 @@ internal AzureResourcePropertiesBase(global::System.Management.Automation.PSObje // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBaseInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBaseInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBase DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBase DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AzureResourcePropertiesBase(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBase DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBase DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AzureResourcePropertiesBase(content); } @@ -129,12 +135,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBase FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBase FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The azure resource properties [System.ComponentModel.TypeConverter(typeof(AzureResourcePropertiesBaseTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureResourcePropertiesBase.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureResourcePropertiesBase.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureResourcePropertiesBase.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureResourcePropertiesBase.TypeConverter.cs index 603f92d0188b..942585a6c3a6 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureResourcePropertiesBase.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureResourcePropertiesBase.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBase ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBase ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBase).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBase).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureResourcePropertiesBase.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureResourcePropertiesBase.cs similarity index 89% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureResourcePropertiesBase.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureResourcePropertiesBase.cs index cb0240d990ee..bae11939a288 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureResourcePropertiesBase.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureResourcePropertiesBase.cs @@ -3,18 +3,18 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The azure resource properties public partial class AzureResourcePropertiesBase : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBase, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBaseInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBase, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBaseInternal { /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBaseInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBaseInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _type= @"KeyVault"; @@ -37,6 +37,9 @@ public partial interface IAzureResourcePropertiesBase : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = true, ReadOnly = true, + Read = true, + Create = true, + Update = true, Description = @"The azure resource type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureResourcePropertiesBase.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureResourcePropertiesBase.json.cs similarity index 92% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureResourcePropertiesBase.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureResourcePropertiesBase.json.cs index b40ac68e7ac0..c37e303f363c 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/AzureResourcePropertiesBase.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/AzureResourcePropertiesBase.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -65,20 +65,20 @@ internal AzureResourcePropertiesBase(Microsoft.Azure.PowerShell.Cmdlets.ServiceL { return; } - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBase. - /// Note: the Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBase interface - /// is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBase. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBase interface is polymorphic, + /// and the precise model class that will get deserialized is determined at runtime based on the payload. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBase. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBase. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAzureResourcePropertiesBase FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAzureResourcePropertiesBase FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { if (!(node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json)) { diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/BasicErrorDryrunPrerequisiteResult.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/BasicErrorDryrunPrerequisiteResult.PowerShell.cs similarity index 70% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/BasicErrorDryrunPrerequisiteResult.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/BasicErrorDryrunPrerequisiteResult.PowerShell.cs index 1b0264870e30..6e320eb705e3 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/BasicErrorDryrunPrerequisiteResult.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/BasicErrorDryrunPrerequisiteResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class BasicErrorDryrunPrerequisiteResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -70,21 +78,21 @@ internal BasicErrorDryrunPrerequisiteResult(global::System.Collections.IDictiona // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IBasicErrorDryrunPrerequisiteResultInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IBasicErrorDryrunPrerequisiteResultInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IBasicErrorDryrunPrerequisiteResultInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IBasicErrorDryrunPrerequisiteResultInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IBasicErrorDryrunPrerequisiteResultInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IBasicErrorDryrunPrerequisiteResultInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IBasicErrorDryrunPrerequisiteResultInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IBasicErrorDryrunPrerequisiteResultInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResultInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPrerequisiteResultType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResultInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPrerequisiteResultType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResultInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResultInternal)this).Type, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -99,43 +107,43 @@ internal BasicErrorDryrunPrerequisiteResult(global::System.Management.Automation // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IBasicErrorDryrunPrerequisiteResultInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IBasicErrorDryrunPrerequisiteResultInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IBasicErrorDryrunPrerequisiteResultInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IBasicErrorDryrunPrerequisiteResultInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IBasicErrorDryrunPrerequisiteResultInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IBasicErrorDryrunPrerequisiteResultInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IBasicErrorDryrunPrerequisiteResultInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IBasicErrorDryrunPrerequisiteResultInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResultInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPrerequisiteResultType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResultInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPrerequisiteResultType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResultInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResultInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IBasicErrorDryrunPrerequisiteResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IBasicErrorDryrunPrerequisiteResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new BasicErrorDryrunPrerequisiteResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IBasicErrorDryrunPrerequisiteResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IBasicErrorDryrunPrerequisiteResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new BasicErrorDryrunPrerequisiteResult(content); } @@ -147,12 +155,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IBasicErrorDryrunPrerequisiteResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IBasicErrorDryrunPrerequisiteResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The represent of basic error [System.ComponentModel.TypeConverter(typeof(BasicErrorDryrunPrerequisiteResultTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/BasicErrorDryrunPrerequisiteResult.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/BasicErrorDryrunPrerequisiteResult.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/BasicErrorDryrunPrerequisiteResult.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/BasicErrorDryrunPrerequisiteResult.TypeConverter.cs index 772111e04e47..beedceae6a5d 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/BasicErrorDryrunPrerequisiteResult.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/BasicErrorDryrunPrerequisiteResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -108,14 +108,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IBasicErrorDryrunPrerequisiteResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IBasicErrorDryrunPrerequisiteResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IBasicErrorDryrunPrerequisiteResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IBasicErrorDryrunPrerequisiteResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/BasicErrorDryrunPrerequisiteResult.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/BasicErrorDryrunPrerequisiteResult.cs similarity index 81% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/BasicErrorDryrunPrerequisiteResult.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/BasicErrorDryrunPrerequisiteResult.cs index b2b089192aca..76d8129fdfa0 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/BasicErrorDryrunPrerequisiteResult.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/BasicErrorDryrunPrerequisiteResult.cs @@ -3,21 +3,21 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The represent of basic error public partial class BasicErrorDryrunPrerequisiteResult : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IBasicErrorDryrunPrerequisiteResult, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IBasicErrorDryrunPrerequisiteResultInternal, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IBasicErrorDryrunPrerequisiteResult, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IBasicErrorDryrunPrerequisiteResultInternal, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult __dryrunPrerequisiteResult = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunPrerequisiteResult(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResult __dryrunPrerequisiteResult = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunPrerequisiteResult(); /// Backing field for property. private string _code; @@ -34,13 +34,14 @@ public partial class BasicErrorDryrunPrerequisiteResult : public string Message { get => this._message; set => this._message = value; } /// The type of dryrun result. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Constant] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPrerequisiteResultType Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResultInternal)__dryrunPrerequisiteResult).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResultInternal)__dryrunPrerequisiteResult).Type = value ; } + public string Type { get => "basicError"; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResultInternal)__dryrunPrerequisiteResult).Type = "basicError"; } /// Creates an new instance. public BasicErrorDryrunPrerequisiteResult() { - + this.__dryrunPrerequisiteResult.Type = "basicError"; } /// Validates that this object meets the validation criteria. @@ -58,12 +59,15 @@ public BasicErrorDryrunPrerequisiteResult() /// The represent of basic error public partial interface IBasicErrorDryrunPrerequisiteResult : Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResult { /// The error code. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -72,6 +76,9 @@ public partial interface IBasicErrorDryrunPrerequisiteResult : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The error message.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -80,7 +87,7 @@ public partial interface IBasicErrorDryrunPrerequisiteResult : } /// The represent of basic error internal partial interface IBasicErrorDryrunPrerequisiteResultInternal : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResultInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResultInternal { /// The error code. string Code { get; set; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/BasicErrorDryrunPrerequisiteResult.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/BasicErrorDryrunPrerequisiteResult.json.cs similarity index 92% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/BasicErrorDryrunPrerequisiteResult.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/BasicErrorDryrunPrerequisiteResult.json.cs index 528d68dae2fd..260285f3fb51 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/BasicErrorDryrunPrerequisiteResult.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/BasicErrorDryrunPrerequisiteResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -65,20 +65,20 @@ internal BasicErrorDryrunPrerequisiteResult(Microsoft.Azure.PowerShell.Cmdlets.S { return; } - __dryrunPrerequisiteResult = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunPrerequisiteResult(json); - {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} - {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + __dryrunPrerequisiteResult = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunPrerequisiteResult(json); + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IBasicErrorDryrunPrerequisiteResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IBasicErrorDryrunPrerequisiteResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IBasicErrorDryrunPrerequisiteResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IBasicErrorDryrunPrerequisiteResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IBasicErrorDryrunPrerequisiteResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IBasicErrorDryrunPrerequisiteResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new BasicErrorDryrunPrerequisiteResult(json) : null; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfo.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfo.PowerShell.cs similarity index 63% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfo.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfo.PowerShell.cs index 408f5b0ac05a..b5bba667fc73 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfo.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfo.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -57,7 +57,15 @@ public partial class ConfigurationInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -72,25 +80,25 @@ internal ConfigurationInfo(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("DeleteOrUpdateBehavior")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoInternal)this).DeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoInternal)this).DeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoInternal)this).DeleteOrUpdateBehavior = (string) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoInternal)this).DeleteOrUpdateBehavior, global::System.Convert.ToString); } if (content.Contains("Action")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType?) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoInternal)this).Action = (string) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoInternal)this).Action, global::System.Convert.ToString); } if (content.Contains("CustomizedKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoInternal)this).CustomizedKey = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys) content.GetValueForProperty("CustomizedKey",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoInternal)this).CustomizedKey, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoCustomizedKeysTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoInternal)this).CustomizedKey = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys) content.GetValueForProperty("CustomizedKey",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoInternal)this).CustomizedKey, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoCustomizedKeysTypeConverter.ConvertFrom); } if (content.Contains("AdditionalConfiguration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoInternal)this).AdditionalConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations) content.GetValueForProperty("AdditionalConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoInternal)this).AdditionalConfiguration, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoAdditionalConfigurationsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoInternal)this).AdditionalConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations) content.GetValueForProperty("AdditionalConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoInternal)this).AdditionalConfiguration, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoAdditionalConfigurationsTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -105,47 +113,45 @@ internal ConfigurationInfo(global::System.Management.Automation.PSObject content // actually deserialize if (content.Contains("DeleteOrUpdateBehavior")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoInternal)this).DeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoInternal)this).DeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoInternal)this).DeleteOrUpdateBehavior = (string) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoInternal)this).DeleteOrUpdateBehavior, global::System.Convert.ToString); } if (content.Contains("Action")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType?) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoInternal)this).Action = (string) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoInternal)this).Action, global::System.Convert.ToString); } if (content.Contains("CustomizedKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoInternal)this).CustomizedKey = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys) content.GetValueForProperty("CustomizedKey",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoInternal)this).CustomizedKey, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoCustomizedKeysTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoInternal)this).CustomizedKey = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys) content.GetValueForProperty("CustomizedKey",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoInternal)this).CustomizedKey, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoCustomizedKeysTypeConverter.ConvertFrom); } if (content.Contains("AdditionalConfiguration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoInternal)this).AdditionalConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations) content.GetValueForProperty("AdditionalConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoInternal)this).AdditionalConfiguration, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoAdditionalConfigurationsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoInternal)this).AdditionalConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations) content.GetValueForProperty("AdditionalConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoInternal)this).AdditionalConfiguration, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoAdditionalConfigurationsTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ConfigurationInfo(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ConfigurationInfo(content); } @@ -155,12 +161,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The configuration information, used to generate configurations or save to applications [System.ComponentModel.TypeConverter(typeof(ConfigurationInfoTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfo.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfo.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfo.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfo.TypeConverter.cs index e1fed8292a32..c5b5a33263f8 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfo.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfo.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfo.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfo.cs similarity index 72% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfo.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfo.cs index c4ac47346971..b7dfa52f1fd5 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfo.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfo.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -11,48 +11,48 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Pre /// The configuration information, used to generate configurations or save to applications /// public partial class ConfigurationInfo : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? _action; + private string _action; /// /// Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied /// to the source application. Default is enable. If optOut, no configuration change will be made on source. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? Action { get => this._action; set => this._action = value; } + public string Action { get => this._action; set => this._action = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations _additionalConfiguration; + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations _additionalConfiguration; /// /// A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this /// property is to full fill more customized configurations /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations AdditionalConfiguration { get => (this._additionalConfiguration = this._additionalConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoAdditionalConfigurations()); set => this._additionalConfiguration = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations AdditionalConfiguration { get => (this._additionalConfiguration = this._additionalConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoAdditionalConfigurations()); set => this._additionalConfiguration = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys _customizedKey; + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys _customizedKey; /// /// Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be /// used for generate configurations /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys CustomizedKey { get => (this._customizedKey = this._customizedKey ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoCustomizedKeys()); set => this._customizedKey = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys CustomizedKey { get => (this._customizedKey = this._customizedKey ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoCustomizedKeys()); set => this._customizedKey = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? _deleteOrUpdateBehavior; + private string _deleteOrUpdateBehavior; /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get => this._deleteOrUpdateBehavior; set => this._deleteOrUpdateBehavior = value; } + public string DeleteOrUpdateBehavior { get => this._deleteOrUpdateBehavior; set => this._deleteOrUpdateBehavior = value; } /// Creates an new instance. public ConfigurationInfo() @@ -71,10 +71,14 @@ public partial interface IConfigurationInfo : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied to the source application. Default is enable. If optOut, no configuration change will be made on source.", SerializedName = @"action", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? Action { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + string Action { get; set; } /// /// A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this /// property is to full fill more customized configurations @@ -82,10 +86,13 @@ public partial interface IConfigurationInfo : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this property is to full fill more customized configurations", SerializedName = @"additionalConfigurations", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations AdditionalConfiguration { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations) })] + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations AdditionalConfiguration { get; set; } /// /// Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be /// used for generate configurations @@ -93,20 +100,27 @@ public partial interface IConfigurationInfo : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be used for generate configurations", SerializedName = @"customizedKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys CustomizedKey { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys) })] + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys CustomizedKey { get; set; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether to clean up previous operation when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string DeleteOrUpdateBehavior { get; set; } } /// The configuration information, used to generate configurations or save to applications @@ -117,21 +131,23 @@ internal partial interface IConfigurationInfoInternal /// Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied /// to the source application. Default is enable. If optOut, no configuration change will be made on source. /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? Action { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + string Action { get; set; } /// /// A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this /// property is to full fill more customized configurations /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations AdditionalConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations AdditionalConfiguration { get; set; } /// /// Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be /// used for generate configurations /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys CustomizedKey { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys CustomizedKey { get; set; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string DeleteOrUpdateBehavior { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfo.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfo.json.cs similarity index 91% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfo.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfo.json.cs index a25db7096226..2dbbc2c68941 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfo.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfo.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -67,21 +67,21 @@ internal ConfigurationInfo(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runt { return; } - {_deleteOrUpdateBehavior = If( json?.PropertyT("deleteOrUpdateBehavior"), out var __jsonDeleteOrUpdateBehavior) ? (string)__jsonDeleteOrUpdateBehavior : (string)DeleteOrUpdateBehavior;} - {_action = If( json?.PropertyT("action"), out var __jsonAction) ? (string)__jsonAction : (string)Action;} - {_customizedKey = If( json?.PropertyT("customizedKeys"), out var __jsonCustomizedKeys) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoCustomizedKeys.FromJson(__jsonCustomizedKeys) : CustomizedKey;} - {_additionalConfiguration = If( json?.PropertyT("additionalConfigurations"), out var __jsonAdditionalConfigurations) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoAdditionalConfigurations.FromJson(__jsonAdditionalConfigurations) : AdditionalConfiguration;} + {_deleteOrUpdateBehavior = If( json?.PropertyT("deleteOrUpdateBehavior"), out var __jsonDeleteOrUpdateBehavior) ? (string)__jsonDeleteOrUpdateBehavior : (string)_deleteOrUpdateBehavior;} + {_action = If( json?.PropertyT("action"), out var __jsonAction) ? (string)__jsonAction : (string)_action;} + {_customizedKey = If( json?.PropertyT("customizedKeys"), out var __jsonCustomizedKeys) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoCustomizedKeys.FromJson(__jsonCustomizedKeys) : _customizedKey;} + {_additionalConfiguration = If( json?.PropertyT("additionalConfigurations"), out var __jsonAdditionalConfigurations) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoAdditionalConfigurations.FromJson(__jsonAdditionalConfigurations) : _additionalConfiguration;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new ConfigurationInfo(json) : null; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoAdditionalConfigurations.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoAdditionalConfigurations.PowerShell.cs similarity index 81% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoAdditionalConfigurations.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoAdditionalConfigurations.PowerShell.cs index 1f4349af5a72..05a2183b656d 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoAdditionalConfigurations.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoAdditionalConfigurations.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -58,7 +58,15 @@ public partial class ConfigurationInfoAdditionalConfigurations partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -77,7 +85,7 @@ internal ConfigurationInfoAdditionalConfigurations(global::System.Collections.ID } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -96,29 +104,29 @@ internal ConfigurationInfoAdditionalConfigurations(global::System.Management.Aut } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ConfigurationInfoAdditionalConfigurations(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ConfigurationInfoAdditionalConfigurations(content); } @@ -131,12 +139,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this /// property is to full fill more customized configurations diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoAdditionalConfigurations.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoAdditionalConfigurations.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoAdditionalConfigurations.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoAdditionalConfigurations.TypeConverter.cs index 209dae4247d5..2285a8998ad6 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoAdditionalConfigurations.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoAdditionalConfigurations.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoAdditionalConfigurations.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoAdditionalConfigurations.cs similarity index 92% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoAdditionalConfigurations.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoAdditionalConfigurations.cs index ac75aa109327..c18ef6f53193 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoAdditionalConfigurations.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoAdditionalConfigurations.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -12,8 +12,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Pre /// property is to full fill more customized configurations /// public partial class ConfigurationInfoAdditionalConfigurations : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurationsInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurationsInternal { /// diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoAdditionalConfigurations.dictionary.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoAdditionalConfigurations.dictionary.cs similarity index 96% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoAdditionalConfigurations.dictionary.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoAdditionalConfigurations.dictionary.cs index 0f53096fcf54..0ec3e62a8a13 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoAdditionalConfigurations.dictionary.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoAdditionalConfigurations.dictionary.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -70,6 +70,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoAdditionalConfigurations source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoAdditionalConfigurations source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoAdditionalConfigurations.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoAdditionalConfigurations.json.cs similarity index 94% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoAdditionalConfigurations.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoAdditionalConfigurations.json.cs index 7d14125c3e96..e526dcd6aa68 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoAdditionalConfigurations.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoAdditionalConfigurations.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -74,13 +74,13 @@ internal ConfigurationInfoAdditionalConfigurations(Microsoft.Azure.PowerShell.Cm } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new ConfigurationInfoAdditionalConfigurations(json) : null; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoCustomizedKeys.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoCustomizedKeys.PowerShell.cs similarity index 81% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoCustomizedKeys.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoCustomizedKeys.PowerShell.cs index e6093882266b..0560fffc05c2 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoCustomizedKeys.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoCustomizedKeys.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -58,7 +58,15 @@ public partial class ConfigurationInfoCustomizedKeys partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -77,7 +85,7 @@ internal ConfigurationInfoCustomizedKeys(global::System.Collections.IDictionary } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -96,29 +104,27 @@ internal ConfigurationInfoCustomizedKeys(global::System.Management.Automation.PS } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ConfigurationInfoCustomizedKeys(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ConfigurationInfoCustomizedKeys(content); } @@ -128,12 +134,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be /// used for generate configurations diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoCustomizedKeys.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoCustomizedKeys.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoCustomizedKeys.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoCustomizedKeys.TypeConverter.cs index 08f2b9828dc0..9303f4cc0397 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoCustomizedKeys.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoCustomizedKeys.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoCustomizedKeys.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoCustomizedKeys.cs similarity index 92% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoCustomizedKeys.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoCustomizedKeys.cs index 4683f62ede9c..def1dfeff8a2 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoCustomizedKeys.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoCustomizedKeys.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -12,8 +12,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Pre /// used for generate configurations /// public partial class ConfigurationInfoCustomizedKeys : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeysInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeysInternal { /// Creates an new instance. diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoCustomizedKeys.dictionary.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoCustomizedKeys.dictionary.cs similarity index 96% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoCustomizedKeys.dictionary.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoCustomizedKeys.dictionary.cs index 822a58da7cb5..7ce0076b0155 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoCustomizedKeys.dictionary.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoCustomizedKeys.dictionary.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -70,6 +70,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfoCustomizedKeys source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoCustomizedKeys source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoCustomizedKeys.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoCustomizedKeys.json.cs similarity index 95% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoCustomizedKeys.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoCustomizedKeys.json.cs index c02c2378d73f..ac12bbee896a 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationInfoCustomizedKeys.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationInfoCustomizedKeys.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -74,13 +74,13 @@ internal ConfigurationInfoCustomizedKeys(Microsoft.Azure.PowerShell.Cmdlets.Serv } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new ConfigurationInfoCustomizedKeys(json) : null; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationName.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationName.PowerShell.cs similarity index 74% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationName.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationName.PowerShell.cs index dbb784742dca..4b8b8a1b511b 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationName.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationName.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class ConfigurationName partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -70,17 +78,17 @@ internal ConfigurationName(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameInternal)this).Value, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameInternal)this).Description, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -95,39 +103,37 @@ internal ConfigurationName(global::System.Management.Automation.PSObject content // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameInternal)this).Value, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameInternal)this).Description, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationName DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationName DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ConfigurationName(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationName DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationName DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ConfigurationName(content); } @@ -137,12 +143,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationName FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationName FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The configuration names. [System.ComponentModel.TypeConverter(typeof(ConfigurationNameTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationName.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationName.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationName.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationName.TypeConverter.cs index 087347d92ab0..46e22b57d7ed 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationName.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationName.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationName ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationName ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationName).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationName).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationName.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationName.cs similarity index 93% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationName.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationName.cs index 3f126ca976e6..8d6cacaa9d46 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationName.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationName.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The configuration names. public partial class ConfigurationName : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationName, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationName, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameInternal { /// Backing field for property. @@ -40,6 +40,9 @@ public partial interface IConfigurationName : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Description for the configuration name.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -48,6 +51,9 @@ public partial interface IConfigurationName : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"value", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationName.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationName.json.cs similarity index 94% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationName.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationName.json.cs index 84e80284e383..52e8fbe464ce 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationName.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationName.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ConfigurationName(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runt { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)_value;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationName. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationName. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationName. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationName. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationName FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationName FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new ConfigurationName(json) : null; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNameItem.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNameItem.PowerShell.cs similarity index 60% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNameItem.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNameItem.PowerShell.cs index bcbe1fe9d68b..7611ada96096 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNameItem.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNameItem.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -54,7 +54,15 @@ public partial class ConfigurationNameItem partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -69,29 +77,29 @@ internal ConfigurationNameItem(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItemInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNames) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItemInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationNamesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItemInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNames) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItemInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationNamesTypeConverter.ConvertFrom); } if (content.Contains("ClientType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItemInternal)this).ClientType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType?) content.GetValueForProperty("ClientType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItemInternal)this).ClientType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItemInternal)this).ClientType = (string) content.GetValueForProperty("ClientType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItemInternal)this).ClientType, global::System.Convert.ToString); } if (content.Contains("AuthType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItemInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType?) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItemInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItemInternal)this).AuthType = (string) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItemInternal)this).AuthType, global::System.Convert.ToString); } if (content.Contains("TargetService")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItemInternal)this).TargetService = (string) content.GetValueForProperty("TargetService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItemInternal)this).TargetService, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItemInternal)this).TargetService = (string) content.GetValueForProperty("TargetService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItemInternal)this).TargetService, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItemInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationName[]) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItemInternal)this).Name, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationNameTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItemInternal)this).Name = (System.Collections.Generic.List) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItemInternal)this).Name, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationNameTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -106,51 +114,49 @@ internal ConfigurationNameItem(global::System.Management.Automation.PSObject con // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItemInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNames) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItemInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationNamesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItemInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNames) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItemInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationNamesTypeConverter.ConvertFrom); } if (content.Contains("ClientType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItemInternal)this).ClientType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType?) content.GetValueForProperty("ClientType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItemInternal)this).ClientType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItemInternal)this).ClientType = (string) content.GetValueForProperty("ClientType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItemInternal)this).ClientType, global::System.Convert.ToString); } if (content.Contains("AuthType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItemInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType?) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItemInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItemInternal)this).AuthType = (string) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItemInternal)this).AuthType, global::System.Convert.ToString); } if (content.Contains("TargetService")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItemInternal)this).TargetService = (string) content.GetValueForProperty("TargetService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItemInternal)this).TargetService, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItemInternal)this).TargetService = (string) content.GetValueForProperty("TargetService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItemInternal)this).TargetService, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItemInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationName[]) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItemInternal)this).Name, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationNameTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItemInternal)this).Name = (System.Collections.Generic.List) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItemInternal)this).Name, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationNameTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItem DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ConfigurationNameItem(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ConfigurationNameItem(content); } @@ -160,12 +166,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } [System.ComponentModel.TypeConverter(typeof(ConfigurationNameItemTypeConverter))] public partial interface IConfigurationNameItem diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNameItem.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNameItem.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNameItem.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNameItem.TypeConverter.cs index 5db64b9dbce8..b45ff826f4a8 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNameItem.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNameItem.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItem ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItem ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItem).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItem).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNameItem.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNameItem.cs similarity index 55% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNameItem.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNameItem.cs index ed9f67bd898e..a63f00e715da 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNameItem.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNameItem.cs @@ -3,40 +3,40 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; public partial class ConfigurationNameItem : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItem, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItemInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItem, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItemInternal { /// The auth type. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType? AuthType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNamesInternal)Property).AuthType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNamesInternal)Property).AuthType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType)""); } + public string AuthType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNamesInternal)Property).AuthType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNamesInternal)Property).AuthType = value ?? null; } /// The client type for configuration names. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType? ClientType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNamesInternal)Property).ClientType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNamesInternal)Property).ClientType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType)""); } + public string ClientType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNamesInternal)Property).ClientType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNamesInternal)Property).ClientType = value ?? null; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNames Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItemInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationNames()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNames Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItemInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationNames()); set { {_property = value;} } } /// The configuration names to be set in compute service environment. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationName[] Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNamesInternal)Property).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNamesInternal)Property).Name = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNamesInternal)Property).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNamesInternal)Property).Name = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNames _property; + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNames _property; /// The result detail. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNames Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationNames()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNames Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationNames()); set => this._property = value; } /// The target service provider name and resource name. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string TargetService { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNamesInternal)Property).TargetService; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNamesInternal)Property).TargetService = value ?? null; } + public string TargetService { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNamesInternal)Property).TargetService; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNamesInternal)Property).TargetService = value ?? null; } /// Creates an new instance. public ConfigurationNameItem() @@ -51,30 +51,44 @@ public partial interface IConfigurationNameItem : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The auth type.", SerializedName = @"authType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType? AuthType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("systemAssignedIdentity", "userAssignedIdentity", "servicePrincipalSecret", "servicePrincipalCertificate", "secret", "accessKey", "userAccount")] + string AuthType { get; set; } /// The client type for configuration names. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The client type for configuration names.", SerializedName = @"clientType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType? ClientType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] + string ClientType { get; set; } /// The configuration names to be set in compute service environment. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The configuration names to be set in compute service environment.", SerializedName = @"names", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationName) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationName[] Name { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationName) })] + System.Collections.Generic.List Name { get; set; } /// The target service provider name and resource name. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The target service provider name and resource name.", SerializedName = @"targetService", PossibleTypes = new [] { typeof(string) })] @@ -85,13 +99,15 @@ internal partial interface IConfigurationNameItemInternal { /// The auth type. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType? AuthType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("systemAssignedIdentity", "userAssignedIdentity", "servicePrincipalSecret", "servicePrincipalCertificate", "secret", "accessKey", "userAccount")] + string AuthType { get; set; } /// The client type for configuration names. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType? ClientType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] + string ClientType { get; set; } /// The configuration names to be set in compute service environment. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationName[] Name { get; set; } + System.Collections.Generic.List Name { get; set; } /// The result detail. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNames Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNames Property { get; set; } /// The target service provider name and resource name. string TargetService { get; set; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNameItem.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNameItem.json.cs similarity index 93% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNameItem.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNameItem.json.cs index 9999c2dd1420..9d6e97681af4 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNameItem.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNameItem.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -64,18 +64,18 @@ internal ConfigurationNameItem(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker. { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationNames.FromJson(__jsonProperties) : Property;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationNames.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItem. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItem. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItem. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItem. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new ConfigurationNameItem(json) : null; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNameResult.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNameResult.PowerShell.cs similarity index 70% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNameResult.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNameResult.PowerShell.cs index 1ef4862ca126..fed899e6ef6a 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNameResult.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNameResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -57,7 +57,15 @@ public partial class ConfigurationNameResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -72,17 +80,17 @@ internal ConfigurationNameResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItem[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationNameItemTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationNameItemTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -97,39 +105,37 @@ internal ConfigurationNameResult(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItem[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationNameItemTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationNameItemTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ConfigurationNameResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ConfigurationNameResult(content); } @@ -139,12 +145,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Configuration Name list which will be set based on different target resource, client type, auth type. [System.ComponentModel.TypeConverter(typeof(ConfigurationNameResultTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNameResult.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNameResult.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNameResult.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNameResult.TypeConverter.cs index 62162b5a585a..060bfde274c7 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNameResult.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNameResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNameResult.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNameResult.cs similarity index 76% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNameResult.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNameResult.cs index 56a3d8b7865a..0a95e0b07aa1 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNameResult.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNameResult.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -11,12 +11,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Pre /// Configuration Name list which will be set based on different target resource, client type, auth type. /// public partial class ConfigurationNameResult : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameResult, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameResultInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameResult, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameResultInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Backing field for property. private string _nextLink; @@ -26,11 +26,11 @@ public partial class ConfigurationNameResult : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItem[] _value; + private System.Collections.Generic.List _value; /// Expected configuration names for each target service. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItem[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public ConfigurationNameResult() @@ -46,6 +46,9 @@ public partial interface IConfigurationNameResult : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Link to next page of resources.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -54,10 +57,13 @@ public partial interface IConfigurationNameResult : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Expected configuration names for each target service.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItem) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItem[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItem) })] + System.Collections.Generic.List Value { get; set; } } /// Configuration Name list which will be set based on different target resource, client type, auth type. @@ -67,7 +73,7 @@ internal partial interface IConfigurationNameResultInternal /// Link to next page of resources. string NextLink { get; set; } /// Expected configuration names for each target service. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItem[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNameResult.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNameResult.json.cs similarity index 89% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNameResult.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNameResult.json.cs index 51e3589d0ff6..4159cd142b04 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNameResult.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNameResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -67,19 +67,19 @@ internal ConfigurationNameResult(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinke { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItem) (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationNameItem.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItem) (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationNameItem.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.ServiceLinker.Models.Api20221101Preview.IConfigurationNameResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new ConfigurationNameResult(json) : null; } @@ -112,7 +112,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode To } container.Add("value",__w); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNames.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNames.PowerShell.cs similarity index 65% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNames.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNames.PowerShell.cs index fe3af8c5026e..8d3ec21979fc 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNames.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNames.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -57,7 +57,15 @@ public partial class ConfigurationNames partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -72,25 +80,25 @@ internal ConfigurationNames(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("TargetService")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNamesInternal)this).TargetService = (string) content.GetValueForProperty("TargetService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNamesInternal)this).TargetService, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNamesInternal)this).TargetService = (string) content.GetValueForProperty("TargetService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNamesInternal)this).TargetService, global::System.Convert.ToString); } if (content.Contains("ClientType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNamesInternal)this).ClientType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType?) content.GetValueForProperty("ClientType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNamesInternal)this).ClientType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNamesInternal)this).ClientType = (string) content.GetValueForProperty("ClientType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNamesInternal)this).ClientType, global::System.Convert.ToString); } if (content.Contains("AuthType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNamesInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType?) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNamesInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNamesInternal)this).AuthType = (string) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNamesInternal)this).AuthType, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNamesInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationName[]) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNamesInternal)this).Name, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationNameTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNamesInternal)this).Name = (System.Collections.Generic.List) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNamesInternal)this).Name, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationNameTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -105,47 +113,45 @@ internal ConfigurationNames(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("TargetService")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNamesInternal)this).TargetService = (string) content.GetValueForProperty("TargetService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNamesInternal)this).TargetService, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNamesInternal)this).TargetService = (string) content.GetValueForProperty("TargetService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNamesInternal)this).TargetService, global::System.Convert.ToString); } if (content.Contains("ClientType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNamesInternal)this).ClientType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType?) content.GetValueForProperty("ClientType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNamesInternal)this).ClientType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNamesInternal)this).ClientType = (string) content.GetValueForProperty("ClientType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNamesInternal)this).ClientType, global::System.Convert.ToString); } if (content.Contains("AuthType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNamesInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType?) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNamesInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNamesInternal)this).AuthType = (string) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNamesInternal)this).AuthType, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNamesInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationName[]) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNamesInternal)this).Name, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationNameTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNamesInternal)this).Name = (System.Collections.Generic.List) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNamesInternal)this).Name, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationNameTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNames DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNames DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ConfigurationNames(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNames DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNames DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ConfigurationNames(content); } @@ -155,12 +161,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNames FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNames FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The configuration names which will be set based on specific target resource, client type, auth type. [System.ComponentModel.TypeConverter(typeof(ConfigurationNamesTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNames.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNames.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNames.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNames.TypeConverter.cs index 3f02c873dc19..bf4a058ca1b4 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNames.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNames.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNames ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNames ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNames).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNames).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNames.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNames.cs similarity index 65% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNames.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNames.cs index e191bff4d6e7..8b0332e3ff83 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNames.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNames.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -11,30 +11,30 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Pre /// The configuration names which will be set based on specific target resource, client type, auth type. /// public partial class ConfigurationNames : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNames, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNamesInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNames, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNamesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType? _authType; + private string _authType; /// The auth type. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType? AuthType { get => this._authType; set => this._authType = value; } + public string AuthType { get => this._authType; set => this._authType = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType? _clientType; + private string _clientType; /// The client type for configuration names. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType? ClientType { get => this._clientType; set => this._clientType = value; } + public string ClientType { get => this._clientType; set => this._clientType = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationName[] _name; + private System.Collections.Generic.List _name; /// The configuration names to be set in compute service environment. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationName[] Name { get => this._name; set => this._name = value; } + public System.Collections.Generic.List Name { get => this._name; set => this._name = value; } /// Backing field for property. private string _targetService; @@ -57,30 +57,44 @@ public partial interface IConfigurationNames : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The auth type.", SerializedName = @"authType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType? AuthType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("systemAssignedIdentity", "userAssignedIdentity", "servicePrincipalSecret", "servicePrincipalCertificate", "secret", "accessKey", "userAccount")] + string AuthType { get; set; } /// The client type for configuration names. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The client type for configuration names.", SerializedName = @"clientType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType? ClientType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] + string ClientType { get; set; } /// The configuration names to be set in compute service environment. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The configuration names to be set in compute service environment.", SerializedName = @"names", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationName) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationName[] Name { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationName) })] + System.Collections.Generic.List Name { get; set; } /// The target service provider name and resource name. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The target service provider name and resource name.", SerializedName = @"targetService", PossibleTypes = new [] { typeof(string) })] @@ -92,11 +106,13 @@ internal partial interface IConfigurationNamesInternal { /// The auth type. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType? AuthType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("systemAssignedIdentity", "userAssignedIdentity", "servicePrincipalSecret", "servicePrincipalCertificate", "secret", "accessKey", "userAccount")] + string AuthType { get; set; } /// The client type for configuration names. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType? ClientType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] + string ClientType { get; set; } /// The configuration names to be set in compute service environment. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationName[] Name { get; set; } + System.Collections.Generic.List Name { get; set; } /// The target service provider name and resource name. string TargetService { get; set; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNames.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNames.json.cs similarity index 90% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNames.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNames.json.cs index a8490a989764..7eab6d1633d6 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationNames.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationNames.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -67,21 +67,21 @@ internal ConfigurationNames(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Run { return; } - {_targetService = If( json?.PropertyT("targetService"), out var __jsonTargetService) ? (string)__jsonTargetService : (string)TargetService;} - {_clientType = If( json?.PropertyT("clientType"), out var __jsonClientType) ? (string)__jsonClientType : (string)ClientType;} - {_authType = If( json?.PropertyT("authType"), out var __jsonAuthType) ? (string)__jsonAuthType : (string)AuthType;} - {_name = If( json?.PropertyT("names"), out var __jsonNames) ? If( __jsonNames as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Models.Api20221101Preview.IConfigurationName) (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationName.FromJson(__u) )) ))() : null : Name;} + {_targetService = If( json?.PropertyT("targetService"), out var __jsonTargetService) ? (string)__jsonTargetService : (string)_targetService;} + {_clientType = If( json?.PropertyT("clientType"), out var __jsonClientType) ? (string)__jsonClientType : (string)_clientType;} + {_authType = If( json?.PropertyT("authType"), out var __jsonAuthType) ? (string)__jsonAuthType : (string)_authType;} + {_name = If( json?.PropertyT("names"), out var __jsonNames) ? If( __jsonNames as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationName) (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationName.FromJson(__u) )) ))() : null : _name;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNames. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNames. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNames. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNames. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNames FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNames FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new ConfigurationNames(json) : null; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationResult.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationResult.PowerShell.cs similarity index 72% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationResult.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationResult.PowerShell.cs index 5e536ef0aab4..95ab83d90095 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationResult.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -57,7 +57,15 @@ public partial class ConfigurationResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -72,13 +80,13 @@ internal ConfigurationResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Configuration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationResultInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration[]) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationResultInternal)this).Configuration, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SourceConfigurationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResultInternal)this).Configuration = (System.Collections.Generic.List) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResultInternal)this).Configuration, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SourceConfigurationTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -93,35 +101,33 @@ internal ConfigurationResult(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Configuration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationResultInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration[]) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationResultInternal)this).Configuration, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SourceConfigurationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResultInternal)this).Configuration = (System.Collections.Generic.List) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResultInternal)this).Configuration, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SourceConfigurationTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ConfigurationResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ConfigurationResult(content); } @@ -131,12 +137,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Configurations for source resource, include appSettings, connectionString and serviceBindings [System.ComponentModel.TypeConverter(typeof(ConfigurationResultTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationResult.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationResult.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationResult.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationResult.TypeConverter.cs index 128684e7e3af..3a666690e65a 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationResult.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationResult.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationResult.cs similarity index 72% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationResult.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationResult.cs index 4ab13f26c939..2edc5899c782 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationResult.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationResult.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -11,16 +11,16 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Pre /// Configurations for source resource, include appSettings, connectionString and serviceBindings /// public partial class ConfigurationResult : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationResult, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationResultInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResultInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration[] _configuration; + private System.Collections.Generic.List _configuration; /// The configuration properties for source resource. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration[] Configuration { get => this._configuration; set => this._configuration = value; } + public System.Collections.Generic.List Configuration { get => this._configuration; set => this._configuration = value; } /// Creates an new instance. public ConfigurationResult() @@ -36,10 +36,13 @@ public partial interface IConfigurationResult : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The configuration properties for source resource.", SerializedName = @"configurations", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration[] Configuration { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfiguration) })] + System.Collections.Generic.List Configuration { get; set; } } /// Configurations for source resource, include appSettings, connectionString and serviceBindings @@ -47,7 +50,7 @@ internal partial interface IConfigurationResultInternal { /// The configuration properties for source resource. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration[] Configuration { get; set; } + System.Collections.Generic.List Configuration { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationResult.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationResult.json.cs similarity index 89% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationResult.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationResult.json.cs index e17bc2bb6308..7fdea88e658d 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfigurationResult.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfigurationResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -67,18 +67,18 @@ internal ConfigurationResult(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Ru { return; } - {_configuration = If( json?.PropertyT("configurations"), out var __jsonConfigurations) ? If( __jsonConfigurations as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SourceConfiguration.FromJson(__u) )) ))() : null : Configuration;} + {_configuration = If( json?.PropertyT("configurations"), out var __jsonConfigurations) ? If( __jsonConfigurations as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SourceConfiguration.FromJson(__u) )) ))() : null : _configuration;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new ConfigurationResult(json) : null; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfluentBootstrapServer.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfluentBootstrapServer.PowerShell.cs similarity index 75% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfluentBootstrapServer.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfluentBootstrapServer.PowerShell.cs index 0a91e1fd832f..6f70cef0ba16 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfluentBootstrapServer.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfluentBootstrapServer.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class ConfluentBootstrapServer partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -70,17 +78,17 @@ internal ConfluentBootstrapServer(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("Endpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentBootstrapServerInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentBootstrapServerInternal)this).Endpoint, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentBootstrapServerInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentBootstrapServerInternal)this).Endpoint, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal)this).Type, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -95,39 +103,37 @@ internal ConfluentBootstrapServer(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Endpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentBootstrapServerInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentBootstrapServerInternal)this).Endpoint, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentBootstrapServerInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentBootstrapServerInternal)this).Endpoint, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentBootstrapServer DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentBootstrapServer DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ConfluentBootstrapServer(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentBootstrapServer DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentBootstrapServer DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ConfluentBootstrapServer(content); } @@ -137,12 +143,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentBootstrapServer FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentBootstrapServer FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The service properties when target service type is ConfluentBootstrapServer [System.ComponentModel.TypeConverter(typeof(ConfluentBootstrapServerTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfluentBootstrapServer.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfluentBootstrapServer.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfluentBootstrapServer.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfluentBootstrapServer.TypeConverter.cs index 5b4e6927410f..33f56dfc830b 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfluentBootstrapServer.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfluentBootstrapServer.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentBootstrapServer ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentBootstrapServer ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentBootstrapServer).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentBootstrapServer).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfluentBootstrapServer.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfluentBootstrapServer.cs similarity index 80% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfluentBootstrapServer.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfluentBootstrapServer.cs index 842275be30cd..987557d5c2ed 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfluentBootstrapServer.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfluentBootstrapServer.cs @@ -3,21 +3,21 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The service properties when target service type is ConfluentBootstrapServer public partial class ConfluentBootstrapServer : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentBootstrapServer, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentBootstrapServerInternal, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentBootstrapServer, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentBootstrapServerInternal, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase __targetServiceBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.TargetServiceBase(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase __targetServiceBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.TargetServiceBase(); /// Backing field for property. private string _endpoint; @@ -27,13 +27,14 @@ public partial class ConfluentBootstrapServer : public string Endpoint { get => this._endpoint; set => this._endpoint = value; } /// The target service type. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Constant] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)__targetServiceBase).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)__targetServiceBase).Type = value ; } + public string Type { get => "ConfluentBootstrapServer"; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal)__targetServiceBase).Type = "ConfluentBootstrapServer"; } /// Creates an new instance. public ConfluentBootstrapServer() { - + this.__targetServiceBase.Type = "ConfluentBootstrapServer"; } /// Validates that this object meets the validation criteria. @@ -51,12 +52,15 @@ public ConfluentBootstrapServer() /// The service properties when target service type is ConfluentBootstrapServer public partial interface IConfluentBootstrapServer : Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase { /// The endpoint of service. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The endpoint of service.", SerializedName = @"endpoint", PossibleTypes = new [] { typeof(string) })] @@ -65,7 +69,7 @@ public partial interface IConfluentBootstrapServer : } /// The service properties when target service type is ConfluentBootstrapServer internal partial interface IConfluentBootstrapServerInternal : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal { /// The endpoint of service. string Endpoint { get; set; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfluentBootstrapServer.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfluentBootstrapServer.json.cs similarity index 93% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfluentBootstrapServer.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfluentBootstrapServer.json.cs index fa1be03adc4d..9839f6915a3f 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfluentBootstrapServer.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfluentBootstrapServer.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ConfluentBootstrapServer(Microsoft.Azure.PowerShell.Cmdlets.ServiceLink { return; } - __targetServiceBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.TargetServiceBase(json); - {_endpoint = If( json?.PropertyT("endpoint"), out var __jsonEndpoint) ? (string)__jsonEndpoint : (string)Endpoint;} + __targetServiceBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.TargetServiceBase(json); + {_endpoint = If( json?.PropertyT("endpoint"), out var __jsonEndpoint) ? (string)__jsonEndpoint : (string)_endpoint;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentBootstrapServer. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentBootstrapServer. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentBootstrapServer. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentBootstrapServer. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentBootstrapServer FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentBootstrapServer FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new ConfluentBootstrapServer(json) : null; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfluentSchemaRegistry.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfluentSchemaRegistry.PowerShell.cs similarity index 74% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfluentSchemaRegistry.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfluentSchemaRegistry.PowerShell.cs index c21aa76c05ad..5e29aade842d 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfluentSchemaRegistry.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfluentSchemaRegistry.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class ConfluentSchemaRegistry partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -70,17 +78,17 @@ internal ConfluentSchemaRegistry(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Endpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentSchemaRegistryInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentSchemaRegistryInternal)this).Endpoint, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentSchemaRegistryInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentSchemaRegistryInternal)this).Endpoint, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal)this).Type, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -95,39 +103,37 @@ internal ConfluentSchemaRegistry(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("Endpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentSchemaRegistryInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentSchemaRegistryInternal)this).Endpoint, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentSchemaRegistryInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentSchemaRegistryInternal)this).Endpoint, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentSchemaRegistry DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentSchemaRegistry DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ConfluentSchemaRegistry(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentSchemaRegistry DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentSchemaRegistry DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ConfluentSchemaRegistry(content); } @@ -137,12 +143,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentSchemaRegistry FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentSchemaRegistry FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The service properties when target service type is ConfluentSchemaRegistry [System.ComponentModel.TypeConverter(typeof(ConfluentSchemaRegistryTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfluentSchemaRegistry.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfluentSchemaRegistry.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfluentSchemaRegistry.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfluentSchemaRegistry.TypeConverter.cs index 52b409fd5aa1..4f55f1e313c9 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfluentSchemaRegistry.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfluentSchemaRegistry.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentSchemaRegistry ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentSchemaRegistry ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentSchemaRegistry).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentSchemaRegistry).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfluentSchemaRegistry.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfluentSchemaRegistry.cs similarity index 80% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfluentSchemaRegistry.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfluentSchemaRegistry.cs index 096d7d78d226..78cc62533ddd 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfluentSchemaRegistry.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfluentSchemaRegistry.cs @@ -3,21 +3,21 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The service properties when target service type is ConfluentSchemaRegistry public partial class ConfluentSchemaRegistry : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentSchemaRegistry, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentSchemaRegistryInternal, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentSchemaRegistry, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentSchemaRegistryInternal, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase __targetServiceBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.TargetServiceBase(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase __targetServiceBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.TargetServiceBase(); /// Backing field for property. private string _endpoint; @@ -27,13 +27,14 @@ public partial class ConfluentSchemaRegistry : public string Endpoint { get => this._endpoint; set => this._endpoint = value; } /// The target service type. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Constant] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)__targetServiceBase).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)__targetServiceBase).Type = value ; } + public string Type { get => "ConfluentSchemaRegistry"; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal)__targetServiceBase).Type = "ConfluentSchemaRegistry"; } /// Creates an new instance. public ConfluentSchemaRegistry() { - + this.__targetServiceBase.Type = "ConfluentSchemaRegistry"; } /// Validates that this object meets the validation criteria. @@ -51,12 +52,15 @@ public ConfluentSchemaRegistry() /// The service properties when target service type is ConfluentSchemaRegistry public partial interface IConfluentSchemaRegistry : Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase { /// The endpoint of service. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The endpoint of service.", SerializedName = @"endpoint", PossibleTypes = new [] { typeof(string) })] @@ -65,7 +69,7 @@ public partial interface IConfluentSchemaRegistry : } /// The service properties when target service type is ConfluentSchemaRegistry internal partial interface IConfluentSchemaRegistryInternal : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal { /// The endpoint of service. string Endpoint { get; set; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfluentSchemaRegistry.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfluentSchemaRegistry.json.cs similarity index 93% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfluentSchemaRegistry.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfluentSchemaRegistry.json.cs index 6d52b4930e8c..efc5d3b1c039 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ConfluentSchemaRegistry.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ConfluentSchemaRegistry.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ConfluentSchemaRegistry(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinke { return; } - __targetServiceBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.TargetServiceBase(json); - {_endpoint = If( json?.PropertyT("endpoint"), out var __jsonEndpoint) ? (string)__jsonEndpoint : (string)Endpoint;} + __targetServiceBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.TargetServiceBase(json); + {_endpoint = If( json?.PropertyT("endpoint"), out var __jsonEndpoint) ? (string)__jsonEndpoint : (string)_endpoint;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentSchemaRegistry. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentSchemaRegistry. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentSchemaRegistry. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentSchemaRegistry. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfluentSchemaRegistry FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfluentSchemaRegistry FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new ConfluentSchemaRegistry(json) : null; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/CreateOrUpdateDryrunParameters.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/CreateOrUpdateDryrunParameters.PowerShell.cs new file mode 100644 index 000000000000..c203820186a4 --- /dev/null +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/CreateOrUpdateDryrunParameters.PowerShell.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + + /// The dryrun parameters for creation or update a linker + [System.ComponentModel.TypeConverter(typeof(CreateOrUpdateDryrunParametersTypeConverter))] + public partial class CreateOrUpdateDryrunParameters + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CreateOrUpdateDryrunParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ActionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParametersInternal)this).ActionName = (string) content.GetValueForProperty("ActionName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParametersInternal)this).ActionName, global::System.Convert.ToString); + } + if (content.Contains("VNetSolutionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).VNetSolutionType = (string) content.GetValueForProperty("VNetSolutionType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).VNetSolutionType, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkSolutionFirewallRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolutionFirewallRule = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules) content.GetValueForProperty("PublicNetworkSolutionFirewallRule",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolutionFirewallRule, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.FirewallRulesTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationInfoCustomizedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoCustomizedKey = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys) content.GetValueForProperty("ConfigurationInfoCustomizedKey",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoCustomizedKey, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoCustomizedKeysTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationInfoAdditionalConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoAdditionalConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations) content.GetValueForProperty("ConfigurationInfoAdditionalConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoAdditionalConfiguration, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoAdditionalConfigurationsTypeConverter.ConvertFrom); + } + if (content.Contains("VNetSolutionDeleteOrUpdateBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).VNetSolutionDeleteOrUpdateBehavior = (string) content.GetValueForProperty("VNetSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).VNetSolutionDeleteOrUpdateBehavior, global::System.Convert.ToString); + } + if (content.Contains("SecretStoreKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).SecretStoreKeyVaultId = (string) content.GetValueForProperty("SecretStoreKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).SecretStoreKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("SecretStoreKeyVaultSecretName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).SecretStoreKeyVaultSecretName = (string) content.GetValueForProperty("SecretStoreKeyVaultSecretName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).SecretStoreKeyVaultSecretName, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkSolutionDeleteOrUpdateBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior = (string) content.GetValueForProperty("PublicNetworkSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkSolutionAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolutionAction = (string) content.GetValueForProperty("PublicNetworkSolutionAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolutionAction, global::System.Convert.ToString); + } + if (content.Contains("FirewallRuleIPRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).FirewallRuleIPRange = (System.Collections.Generic.List) content.GetValueForProperty("FirewallRuleIPRange",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).FirewallRuleIPRange, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ConfigurationInfoDeleteOrUpdateBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoDeleteOrUpdateBehavior = (string) content.GetValueForProperty("ConfigurationInfoDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoDeleteOrUpdateBehavior, global::System.Convert.ToString); + } + if (content.Contains("ConfigurationInfoAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoAction = (string) content.GetValueForProperty("ConfigurationInfoAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoAction, global::System.Convert.ToString); + } + if (content.Contains("FirewallRuleAzureService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).FirewallRuleAzureService = (string) content.GetValueForProperty("FirewallRuleAzureService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).FirewallRuleAzureService, global::System.Convert.ToString); + } + if (content.Contains("FirewallRuleCallerClientIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).FirewallRuleCallerClientIP = (string) content.GetValueForProperty("FirewallRuleCallerClientIP",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).FirewallRuleCallerClientIP, global::System.Convert.ToString); + } + if (content.Contains("VNetSolution")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).VNetSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution) content.GetValueForProperty("VNetSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).VNetSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.VNetSolutionTypeConverter.ConvertFrom); + } + if (content.Contains("SecretStore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).SecretStore = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore) content.GetValueForProperty("SecretStore",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).SecretStore, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretStoreTypeConverter.ConvertFrom); + } + if (content.Contains("PublicNetworkSolution")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution) content.GetValueForProperty("PublicNetworkSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.PublicNetworkSolutionTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo) content.GetValueForProperty("ConfigurationInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).TargetService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase) content.GetValueForProperty("TargetService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).TargetService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.TargetServiceBaseTypeConverter.ConvertFrom); + } + if (content.Contains("AuthInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).AuthInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase) content.GetValueForProperty("AuthInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).AuthInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AuthInfoBaseTypeConverter.ConvertFrom); + } + if (content.Contains("ClientType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ClientType = (string) content.GetValueForProperty("ClientType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ClientType, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CreateOrUpdateDryrunParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ActionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParametersInternal)this).ActionName = (string) content.GetValueForProperty("ActionName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParametersInternal)this).ActionName, global::System.Convert.ToString); + } + if (content.Contains("VNetSolutionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).VNetSolutionType = (string) content.GetValueForProperty("VNetSolutionType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).VNetSolutionType, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkSolutionFirewallRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolutionFirewallRule = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules) content.GetValueForProperty("PublicNetworkSolutionFirewallRule",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolutionFirewallRule, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.FirewallRulesTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationInfoCustomizedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoCustomizedKey = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys) content.GetValueForProperty("ConfigurationInfoCustomizedKey",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoCustomizedKey, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoCustomizedKeysTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationInfoAdditionalConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoAdditionalConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations) content.GetValueForProperty("ConfigurationInfoAdditionalConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoAdditionalConfiguration, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoAdditionalConfigurationsTypeConverter.ConvertFrom); + } + if (content.Contains("VNetSolutionDeleteOrUpdateBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).VNetSolutionDeleteOrUpdateBehavior = (string) content.GetValueForProperty("VNetSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).VNetSolutionDeleteOrUpdateBehavior, global::System.Convert.ToString); + } + if (content.Contains("SecretStoreKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).SecretStoreKeyVaultId = (string) content.GetValueForProperty("SecretStoreKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).SecretStoreKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("SecretStoreKeyVaultSecretName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).SecretStoreKeyVaultSecretName = (string) content.GetValueForProperty("SecretStoreKeyVaultSecretName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).SecretStoreKeyVaultSecretName, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkSolutionDeleteOrUpdateBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior = (string) content.GetValueForProperty("PublicNetworkSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkSolutionAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolutionAction = (string) content.GetValueForProperty("PublicNetworkSolutionAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolutionAction, global::System.Convert.ToString); + } + if (content.Contains("FirewallRuleIPRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).FirewallRuleIPRange = (System.Collections.Generic.List) content.GetValueForProperty("FirewallRuleIPRange",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).FirewallRuleIPRange, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ConfigurationInfoDeleteOrUpdateBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoDeleteOrUpdateBehavior = (string) content.GetValueForProperty("ConfigurationInfoDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoDeleteOrUpdateBehavior, global::System.Convert.ToString); + } + if (content.Contains("ConfigurationInfoAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoAction = (string) content.GetValueForProperty("ConfigurationInfoAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoAction, global::System.Convert.ToString); + } + if (content.Contains("FirewallRuleAzureService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).FirewallRuleAzureService = (string) content.GetValueForProperty("FirewallRuleAzureService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).FirewallRuleAzureService, global::System.Convert.ToString); + } + if (content.Contains("FirewallRuleCallerClientIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).FirewallRuleCallerClientIP = (string) content.GetValueForProperty("FirewallRuleCallerClientIP",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).FirewallRuleCallerClientIP, global::System.Convert.ToString); + } + if (content.Contains("VNetSolution")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).VNetSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution) content.GetValueForProperty("VNetSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).VNetSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.VNetSolutionTypeConverter.ConvertFrom); + } + if (content.Contains("SecretStore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).SecretStore = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore) content.GetValueForProperty("SecretStore",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).SecretStore, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretStoreTypeConverter.ConvertFrom); + } + if (content.Contains("PublicNetworkSolution")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution) content.GetValueForProperty("PublicNetworkSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.PublicNetworkSolutionTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo) content.GetValueForProperty("ConfigurationInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).TargetService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase) content.GetValueForProperty("TargetService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).TargetService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.TargetServiceBaseTypeConverter.ConvertFrom); + } + if (content.Contains("AuthInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).AuthInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase) content.GetValueForProperty("AuthInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).AuthInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AuthInfoBaseTypeConverter.ConvertFrom); + } + if (content.Contains("ClientType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ClientType = (string) content.GetValueForProperty("ClientType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ClientType, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).Scope, 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.ServiceLinker.Models.ICreateOrUpdateDryrunParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CreateOrUpdateDryrunParameters(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ICreateOrUpdateDryrunParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CreateOrUpdateDryrunParameters(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ICreateOrUpdateDryrunParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The dryrun parameters for creation or update a linker + [System.ComponentModel.TypeConverter(typeof(CreateOrUpdateDryrunParametersTypeConverter))] + public partial interface ICreateOrUpdateDryrunParameters + + { + + } +} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/CreateOrUpdateDryrunParameters.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/CreateOrUpdateDryrunParameters.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/CreateOrUpdateDryrunParameters.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/CreateOrUpdateDryrunParameters.TypeConverter.cs index c180cb676c42..967c3a3f6c7c 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/CreateOrUpdateDryrunParameters.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/CreateOrUpdateDryrunParameters.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ICreateOrUpdateDryrunParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ICreateOrUpdateDryrunParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ICreateOrUpdateDryrunParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ICreateOrUpdateDryrunParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/CreateOrUpdateDryrunParameters.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/CreateOrUpdateDryrunParameters.cs new file mode 100644 index 000000000000..e61a774c5fdb --- /dev/null +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/CreateOrUpdateDryrunParameters.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + + /// The dryrun parameters for creation or update a linker + public partial class CreateOrUpdateDryrunParameters : + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ICreateOrUpdateDryrunParameters, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ICreateOrUpdateDryrunParametersInternal, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters __dryrunParameters = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunParameters(); + + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerProperties __linkerProperties = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerProperties(); + + /// The name of action for you dryrun job. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Constant] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public string ActionName { get => "createOrUpdate"; } + + /// The authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase AuthInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).AuthInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).AuthInfo = value ?? null /* model class */; } + + /// The application client type + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public string ClientType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).ClientType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).ClientType = value ?? null; } + + /// + /// The connection information consumed by applications, including secrets, connection strings. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo ConfigurationInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).ConfigurationInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).ConfigurationInfo = value ?? null /* model class */; } + + /// + /// Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied + /// to the source application. Default is enable. If optOut, no configuration change will be made on source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public string ConfigurationInfoAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).ConfigurationInfoAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).ConfigurationInfoAction = value ?? null; } + + /// + /// A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this + /// property is to full fill more customized configurations + /// + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).ConfigurationInfoAdditionalConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).ConfigurationInfoAdditionalConfiguration = value ?? null /* model class */; } + + /// + /// Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be + /// used for generate configurations + /// + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).ConfigurationInfoCustomizedKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).ConfigurationInfoCustomizedKey = value ?? null /* model class */; } + + /// + /// Indicates whether to clean up previous operation when Linker is updating or deleting + /// + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public string ConfigurationInfoDeleteOrUpdateBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).ConfigurationInfoDeleteOrUpdateBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).ConfigurationInfoDeleteOrUpdateBehavior = value ?? null; } + + /// Allow Azure services to access the target service if true. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public string FirewallRuleAzureService { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).FirewallRuleAzureService; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).FirewallRuleAzureService = value ?? null; } + + /// + /// Allow caller client IP to access the target service if true. the property is used when connecting local application to + /// target service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public string FirewallRuleCallerClientIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).FirewallRuleCallerClientIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).FirewallRuleCallerClientIP = value ?? null; } + + /// + /// This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client + /// IPs for a given database account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public System.Collections.Generic.List FirewallRuleIPRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).FirewallRuleIPRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).FirewallRuleIPRange = value ?? null /* arrayOf */; } + + /// Internal Acessors for ActionName + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParametersInternal.ActionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParametersInternal)__dryrunParameters).ActionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParametersInternal)__dryrunParameters).ActionName = value ; } + + /// Internal Acessors for ConfigurationInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal.ConfigurationInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).ConfigurationInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).ConfigurationInfo = value ?? null /* model class */; } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).ProvisioningState = value ?? null; } + + /// Internal Acessors for PublicNetworkSolution + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal.PublicNetworkSolution { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).PublicNetworkSolution; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).PublicNetworkSolution = value ?? null /* model class */; } + + /// Internal Acessors for PublicNetworkSolutionFirewallRule + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal.PublicNetworkSolutionFirewallRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).PublicNetworkSolutionFirewallRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).PublicNetworkSolutionFirewallRule = value ?? null /* model class */; } + + /// Internal Acessors for SecretStore + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal.SecretStore { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).SecretStore; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).SecretStore = value ?? null /* model class */; } + + /// Internal Acessors for VNetSolution + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal.VNetSolution { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).VNetSolution; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).VNetSolution = value ?? null /* model class */; } + + /// The provisioning state. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).ProvisioningState; } + + /// The network solution. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution PublicNetworkSolution { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).PublicNetworkSolution; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).PublicNetworkSolution = value ?? null /* model class */; } + + /// + /// Optional. Indicates public network solution. If enable, enable public network access of target service with best try. + /// Default is enable. If optOut, opt out public network access configuration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public string PublicNetworkSolutionAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).PublicNetworkSolutionAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).PublicNetworkSolutionAction = value ?? null; } + + /// + /// Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting + /// + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public string PublicNetworkSolutionDeleteOrUpdateBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).PublicNetworkSolutionDeleteOrUpdateBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).PublicNetworkSolutionDeleteOrUpdateBehavior = value ?? null; } + + /// + /// Describe firewall rules of target service to make sure source application could connect to the target. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules PublicNetworkSolutionFirewallRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).PublicNetworkSolutionFirewallRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).PublicNetworkSolutionFirewallRule = value ?? null /* model class */; } + + /// connection scope in source service. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).Scope = value ?? null; } + + /// An option to store secret value in secure place + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore SecretStore { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).SecretStore; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).SecretStore = value ?? null /* model class */; } + + /// The key vault id to store secret + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public string SecretStoreKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).SecretStoreKeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).SecretStoreKeyVaultId = value ?? null; } + + /// The key vault secret name to store secret, only valid when storing one secret + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public string SecretStoreKeyVaultSecretName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).SecretStoreKeyVaultSecretName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).SecretStoreKeyVaultSecretName = value ?? null; } + + /// The target service properties + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase TargetService { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).TargetService; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).TargetService = value ?? null /* model class */; } + + /// The VNet solution. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution VNetSolution { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).VNetSolution; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).VNetSolution = value ?? null /* model class */; } + + /// + /// Indicates whether to clean up previous operation when Linker is updating or deleting + /// + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public string VNetSolutionDeleteOrUpdateBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).VNetSolutionDeleteOrUpdateBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).VNetSolutionDeleteOrUpdateBehavior = value ?? null; } + + /// Type of VNet solution. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public string VNetSolutionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).VNetSolutionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)__linkerProperties).VNetSolutionType = value ?? null; } + + /// Creates an new instance. + public CreateOrUpdateDryrunParameters() + { + + } + + /// 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.ServiceLinker.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__dryrunParameters), __dryrunParameters); + await eventListener.AssertObjectIsValid(nameof(__dryrunParameters), __dryrunParameters); + await eventListener.AssertNotNull(nameof(__linkerProperties), __linkerProperties); + await eventListener.AssertObjectIsValid(nameof(__linkerProperties), __linkerProperties); + } + } + /// The dryrun parameters for creation or update a linker + public partial interface ICreateOrUpdateDryrunParameters : + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerProperties + { + + } + /// The dryrun parameters for creation or update a linker + internal partial interface ICreateOrUpdateDryrunParametersInternal : + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParametersInternal, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal + { + + } +} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/CreateOrUpdateDryrunParameters.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/CreateOrUpdateDryrunParameters.json.cs similarity index 93% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/CreateOrUpdateDryrunParameters.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/CreateOrUpdateDryrunParameters.json.cs index 9c09e10608e3..5dd5f3ffc2d4 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/CreateOrUpdateDryrunParameters.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/CreateOrUpdateDryrunParameters.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -65,19 +65,19 @@ internal CreateOrUpdateDryrunParameters(Microsoft.Azure.PowerShell.Cmdlets.Servi { return; } - __dryrunParameters = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunParameters(json); - __linkerProperties = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerProperties(json); + __dryrunParameters = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunParameters(json); + __linkerProperties = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerProperties(json); AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ICreateOrUpdateDryrunParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ICreateOrUpdateDryrunParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ICreateOrUpdateDryrunParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ICreateOrUpdateDryrunParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ICreateOrUpdateDryrunParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ICreateOrUpdateDryrunParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new CreateOrUpdateDryrunParameters(json) : null; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DatabaseAadAuthInfo.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DatabaseAadAuthInfo.PowerShell.cs similarity index 77% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DatabaseAadAuthInfo.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DatabaseAadAuthInfo.PowerShell.cs index 9e0b66cc2fc7..e8f64733e620 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DatabaseAadAuthInfo.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DatabaseAadAuthInfo.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class DatabaseAadAuthInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -70,13 +78,13 @@ internal DatabaseAadAuthInfo(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("UserName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)this).UserName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)this).UserName, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -91,35 +99,33 @@ internal DatabaseAadAuthInfo(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("UserName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)this).UserName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)this).UserName, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DatabaseAadAuthInfo(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DatabaseAadAuthInfo(content); } @@ -129,12 +135,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The extra auth info required by Database AAD authentication. [System.ComponentModel.TypeConverter(typeof(DatabaseAadAuthInfoTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DatabaseAadAuthInfo.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DatabaseAadAuthInfo.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DatabaseAadAuthInfo.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DatabaseAadAuthInfo.TypeConverter.cs index 52a4947ba472..46b48b219175 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DatabaseAadAuthInfo.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DatabaseAadAuthInfo.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DatabaseAadAuthInfo.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DatabaseAadAuthInfo.cs similarity index 94% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DatabaseAadAuthInfo.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DatabaseAadAuthInfo.cs index 82b8d1810c96..4cc6002fea00 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DatabaseAadAuthInfo.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DatabaseAadAuthInfo.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The extra auth info required by Database AAD authentication. public partial class DatabaseAadAuthInfo : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfo, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfo, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal { /// Backing field for property. @@ -34,6 +34,9 @@ public partial interface IDatabaseAadAuthInfo : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Username created in the database which is mapped to a user in AAD.", SerializedName = @"userName", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DatabaseAadAuthInfo.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DatabaseAadAuthInfo.json.cs similarity index 94% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DatabaseAadAuthInfo.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DatabaseAadAuthInfo.json.cs index bad7c7ad9ff5..c0eb1a49dadf 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DatabaseAadAuthInfo.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DatabaseAadAuthInfo.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -65,18 +65,18 @@ internal DatabaseAadAuthInfo(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Ru { return; } - {_userName = If( json?.PropertyT("userName"), out var __jsonUserName) ? (string)__jsonUserName : (string)UserName;} + {_userName = If( json?.PropertyT("userName"), out var __jsonUserName) ? (string)__jsonUserName : (string)_userName;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new DatabaseAadAuthInfo(json) : null; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunList.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunList.PowerShell.cs similarity index 71% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunList.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunList.PowerShell.cs index e193e2b39f0d..e33cfa51e71c 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunList.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunList.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class DryrunList partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DryrunList(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DryrunList(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,17 +104,17 @@ internal DryrunList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunResourceTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -121,11 +129,11 @@ internal DryrunList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunResourceTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -135,12 +143,24 @@ internal DryrunList(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The list of dryrun. [System.ComponentModel.TypeConverter(typeof(DryrunListTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunList.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunList.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunList.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunList.TypeConverter.cs index c155edaa21c8..56150af287a5 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunList.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunList.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunList.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunList.cs similarity index 77% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunList.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunList.cs index 0f1e40174f07..e7088ef5715c 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunList.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunList.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The list of dryrun. public partial class DryrunList : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunList, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunListInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunList, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunListInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class DryrunList : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource[] _value; + private System.Collections.Generic.List _value; /// The list of dryrun. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public DryrunList() @@ -41,6 +41,9 @@ public partial interface IDryrunList : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The link used to get the next page of dryrun list.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IDryrunList : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of dryrun.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource) })] + System.Collections.Generic.List Value { get; set; } } /// The list of dryrun. @@ -62,7 +68,7 @@ internal partial interface IDryrunListInternal /// The link used to get the next page of dryrun list. string NextLink { get; set; } /// The list of dryrun. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunList.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunList.json.cs similarity index 90% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunList.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunList.json.cs index e236403ad173..2a347963dfd1 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunList.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunList.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -65,19 +65,19 @@ internal DryrunList(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Jso { return; } - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Models.Api20221101Preview.IDryrunResource) (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunResource.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource) (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunResource.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunList FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunList FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new DryrunList(json) : null; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunOperationPreview.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunOperationPreview.PowerShell.cs similarity index 66% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunOperationPreview.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunOperationPreview.PowerShell.cs index 3811ed759d15..4f99828797b7 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunOperationPreview.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunOperationPreview.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,35 +55,41 @@ public partial class DryrunOperationPreview partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreview DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DryrunOperationPreview(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreview DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DryrunOperationPreview(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,29 +104,29 @@ internal DryrunOperationPreview(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreviewInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreviewInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreviewInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreviewInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("OperationType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreviewInternal)this).OperationType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPreviewOperationType?) content.GetValueForProperty("OperationType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreviewInternal)this).OperationType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPreviewOperationType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreviewInternal)this).OperationType = (string) content.GetValueForProperty("OperationType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreviewInternal)this).OperationType, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreviewInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreviewInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreviewInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreviewInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("Action")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreviewInternal)this).Action = (string) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreviewInternal)this).Action, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreviewInternal)this).Action = (string) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreviewInternal)this).Action, global::System.Convert.ToString); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreviewInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreviewInternal)this).Scope, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreviewInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreviewInternal)this).Scope, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -135,23 +141,23 @@ internal DryrunOperationPreview(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreviewInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreviewInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreviewInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreviewInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("OperationType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreviewInternal)this).OperationType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPreviewOperationType?) content.GetValueForProperty("OperationType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreviewInternal)this).OperationType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPreviewOperationType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreviewInternal)this).OperationType = (string) content.GetValueForProperty("OperationType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreviewInternal)this).OperationType, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreviewInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreviewInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreviewInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreviewInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("Action")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreviewInternal)this).Action = (string) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreviewInternal)this).Action, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreviewInternal)this).Action = (string) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreviewInternal)this).Action, global::System.Convert.ToString); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreviewInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreviewInternal)this).Scope, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreviewInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreviewInternal)this).Scope, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -161,12 +167,24 @@ internal DryrunOperationPreview(global::System.Management.Automation.PSObject co /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreview FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The preview of the operations for creation [System.ComponentModel.TypeConverter(typeof(DryrunOperationPreviewTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunOperationPreview.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunOperationPreview.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunOperationPreview.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunOperationPreview.TypeConverter.cs index dfaa27b5db75..f3945266a456 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunOperationPreview.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunOperationPreview.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreview ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreview).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunOperationPreview.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunOperationPreview.cs similarity index 86% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunOperationPreview.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunOperationPreview.cs index 07f5fbce91ba..94d1339b42c0 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunOperationPreview.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunOperationPreview.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The preview of the operations for creation public partial class DryrunOperationPreview : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreviewInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreview, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreviewInternal { /// Backing field for property. @@ -37,11 +37,11 @@ public partial class DryrunOperationPreview : public string Name { get => this._name; set => this._name = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPreviewOperationType? _operationType; + private string _operationType; /// The operation type [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPreviewOperationType? OperationType { get => this._operationType; set => this._operationType = value; } + public string OperationType { get => this._operationType; set => this._operationType = value; } /// Backing field for property. private string _scope; @@ -68,6 +68,9 @@ public partial interface IDryrunOperationPreview : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The action defined by RBAC, refer https://docs.microsoft.com/azure/role-based-access-control/role-definitions#actions-format", SerializedName = @"action", PossibleTypes = new [] { typeof(string) })] @@ -76,6 +79,9 @@ public partial interface IDryrunOperationPreview : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The description of the operation", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -84,6 +90,9 @@ public partial interface IDryrunOperationPreview : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The operation name", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -92,16 +101,23 @@ public partial interface IDryrunOperationPreview : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The operation type", SerializedName = @"operationType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPreviewOperationType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPreviewOperationType? OperationType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("configConnection", "configNetwork", "configAuth")] + string OperationType { get; set; } /// /// The scope of the operation, refer https://docs.microsoft.com/azure/role-based-access-control/scope-overview /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The scope of the operation, refer https://docs.microsoft.com/azure/role-based-access-control/scope-overview", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -121,7 +137,8 @@ internal partial interface IDryrunOperationPreviewInternal /// The operation name string Name { get; set; } /// The operation type - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPreviewOperationType? OperationType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("configConnection", "configNetwork", "configAuth")] + string OperationType { get; set; } /// /// The scope of the operation, refer https://docs.microsoft.com/azure/role-based-access-control/scope-overview /// diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunOperationPreview.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunOperationPreview.json.cs similarity index 93% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunOperationPreview.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunOperationPreview.json.cs index 02c92d5e2011..9230a25c9899 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunOperationPreview.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunOperationPreview.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -65,22 +65,22 @@ internal DryrunOperationPreview(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_operationType = If( json?.PropertyT("operationType"), out var __jsonOperationType) ? (string)__jsonOperationType : (string)OperationType;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_action = If( json?.PropertyT("action"), out var __jsonAction) ? (string)__jsonAction : (string)Action;} - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_operationType = If( json?.PropertyT("operationType"), out var __jsonOperationType) ? (string)__jsonOperationType : (string)_operationType;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_action = If( json?.PropertyT("action"), out var __jsonAction) ? (string)__jsonAction : (string)_action;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreview. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreview. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreview FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new DryrunOperationPreview(json) : null; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunParameters.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunParameters.PowerShell.cs similarity index 77% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunParameters.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunParameters.PowerShell.cs index 42a5ff1dd8fa..8477b185652f 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunParameters.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunParameters.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,35 +55,41 @@ public partial class DryrunParameters partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DryrunParameters(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DryrunParameters(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,13 +104,13 @@ internal DryrunParameters(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("ActionName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParametersInternal)this).ActionName = (string) content.GetValueForProperty("ActionName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParametersInternal)this).ActionName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParametersInternal)this).ActionName = (string) content.GetValueForProperty("ActionName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParametersInternal)this).ActionName, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -119,7 +125,7 @@ internal DryrunParameters(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("ActionName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParametersInternal)this).ActionName = (string) content.GetValueForProperty("ActionName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParametersInternal)this).ActionName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParametersInternal)this).ActionName = (string) content.GetValueForProperty("ActionName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParametersInternal)this).ActionName, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -129,12 +135,24 @@ internal DryrunParameters(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The parameters of the dryrun [System.ComponentModel.TypeConverter(typeof(DryrunParametersTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunParameters.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunParameters.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunParameters.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunParameters.TypeConverter.cs index cf4c9407d8c5..22bd71ce2361 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunParameters.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunParameters.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunParameters.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunParameters.cs similarity index 90% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunParameters.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunParameters.cs index 1a1b2e8f8e92..896f94a7713b 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunParameters.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunParameters.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The parameters of the dryrun public partial class DryrunParameters : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParameters, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParametersInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParametersInternal { /// Backing field for property. @@ -21,7 +21,7 @@ public partial class DryrunParameters : public string ActionName { get => this._actionName; } /// Internal Acessors for ActionName - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParametersInternal.ActionName { get => this._actionName; set { {_actionName = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParametersInternal.ActionName { get => this._actionName; set { {_actionName = value;} } } /// Creates an new instance. public DryrunParameters() @@ -37,6 +37,9 @@ public partial interface IDryrunParameters : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = true, ReadOnly = true, + Read = true, + Create = true, + Update = true, Description = @"The name of action for you dryrun job.", SerializedName = @"actionName", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunParameters.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunParameters.json.cs similarity index 93% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunParameters.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunParameters.json.cs index 75d6470bce84..0053139fc2c6 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunParameters.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunParameters.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -65,20 +65,20 @@ internal DryrunParameters(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runti { return; } - {_actionName = If( json?.PropertyT("actionName"), out var __jsonActionName) ? (string)__jsonActionName : (string)ActionName;} + {_actionName = If( json?.PropertyT("actionName"), out var __jsonActionName) ? (string)__jsonActionName : (string)_actionName;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParameters. - /// Note: the Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParameters interface is polymorphic, - /// and the precise model class that will get deserialized is determined at runtime based on the payload. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters interface is polymorphic, and the + /// precise model class that will get deserialized is determined at runtime based on the payload. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { if (!(node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json)) { diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunPatch.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunPatch.PowerShell.cs similarity index 57% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunPatch.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunPatch.PowerShell.cs index edd95cbb3cb3..6e979b463b79 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunPatch.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunPatch.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class DryrunPatch partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatch DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatch DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DryrunPatch(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DryrunPatch(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,33 +104,33 @@ internal DryrunPatch(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Parameter")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParameters) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunParametersTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunParametersTypeConverter.ConvertFrom); } if (content.Contains("PrerequisiteResult")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal)this).PrerequisiteResult = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult[]) content.GetValueForProperty("PrerequisiteResult",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal)this).PrerequisiteResult, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunPrerequisiteResultTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal)this).PrerequisiteResult = (System.Collections.Generic.List) content.GetValueForProperty("PrerequisiteResult",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal)this).PrerequisiteResult, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunPrerequisiteResultTypeConverter.ConvertFrom)); } if (content.Contains("OperationPreview")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal)this).OperationPreview = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview[]) content.GetValueForProperty("OperationPreview",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal)this).OperationPreview, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunOperationPreviewTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal)this).OperationPreview = (System.Collections.Generic.List) content.GetValueForProperty("OperationPreview",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal)this).OperationPreview, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunOperationPreviewTypeConverter.ConvertFrom)); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("ParameterActionName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal)this).ParameterActionName = (string) content.GetValueForProperty("ParameterActionName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal)this).ParameterActionName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal)this).ParameterActionName = (string) content.GetValueForProperty("ParameterActionName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal)this).ParameterActionName, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -137,27 +145,27 @@ internal DryrunPatch(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Parameter")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParameters) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunParametersTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunParametersTypeConverter.ConvertFrom); } if (content.Contains("PrerequisiteResult")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal)this).PrerequisiteResult = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult[]) content.GetValueForProperty("PrerequisiteResult",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal)this).PrerequisiteResult, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunPrerequisiteResultTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal)this).PrerequisiteResult = (System.Collections.Generic.List) content.GetValueForProperty("PrerequisiteResult",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal)this).PrerequisiteResult, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunPrerequisiteResultTypeConverter.ConvertFrom)); } if (content.Contains("OperationPreview")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal)this).OperationPreview = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview[]) content.GetValueForProperty("OperationPreview",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal)this).OperationPreview, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunOperationPreviewTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal)this).OperationPreview = (System.Collections.Generic.List) content.GetValueForProperty("OperationPreview",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal)this).OperationPreview, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunOperationPreviewTypeConverter.ConvertFrom)); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("ParameterActionName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal)this).ParameterActionName = (string) content.GetValueForProperty("ParameterActionName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal)this).ParameterActionName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal)this).ParameterActionName = (string) content.GetValueForProperty("ParameterActionName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal)this).ParameterActionName, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -167,12 +175,24 @@ internal DryrunPatch(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// a dryrun job to be updated. [System.ComponentModel.TypeConverter(typeof(DryrunPatchTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunPatch.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunPatch.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunPatch.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunPatch.TypeConverter.cs index 9a3cad824a5f..6899988bdbd4 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunPatch.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunPatch.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatch ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatch ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatch).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatch).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunPatch.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunPatch.cs similarity index 52% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunPatch.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunPatch.cs index 333268984d2f..897ffa1349a2 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunPatch.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunPatch.cs @@ -3,56 +3,60 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// a dryrun job to be updated. public partial class DryrunPatch : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatch, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatch, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal { /// Internal Acessors for OperationPreview - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview[] Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal.OperationPreview { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).OperationPreview; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).OperationPreview = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal.OperationPreview { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).OperationPreview; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).OperationPreview = value ?? null /* arrayOf */; } /// Internal Acessors for Parameter - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParameters Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal.Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).Parameter = value; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal.Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).Parameter = value ?? null /* model class */; } /// Internal Acessors for ParameterActionName - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal.ParameterActionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).ParameterActionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).ParameterActionName = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal.ParameterActionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).ParameterActionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).ParameterActionName = value ?? null; } /// Internal Acessors for PrerequisiteResult - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult[] Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal.PrerequisiteResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).PrerequisiteResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).PrerequisiteResult = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal.PrerequisiteResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).PrerequisiteResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).PrerequisiteResult = value ?? null /* arrayOf */; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunProperties Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunProperties Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatchInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatchInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).ProvisioningState = value ?? null; } /// the preview of the operations for creation [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview[] OperationPreview { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).OperationPreview; } + public System.Collections.Generic.List OperationPreview { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).OperationPreview; } + + /// The parameters of the dryrun + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).Parameter = value ?? null /* model class */; } /// The name of action for you dryrun job. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string ParameterActionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).ParameterActionName; } + public string ParameterActionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).ParameterActionName; } /// the result of the dryrun [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult[] PrerequisiteResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).PrerequisiteResult; } + public System.Collections.Generic.List PrerequisiteResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).PrerequisiteResult; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunProperties _property; /// The properties of the dryrun job. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunProperties()); set => this._property = value; } /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).ProvisioningState; } /// Creates an new instance. public DryrunPatch() @@ -68,14 +72,20 @@ public partial interface IDryrunPatch : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"the preview of the operations for creation", SerializedName = @"operationPreviews", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview[] OperationPreview { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreview) })] + System.Collections.Generic.List OperationPreview { get; } /// The name of action for you dryrun job. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = true, + Update = true, Description = @"The name of action for you dryrun job.", SerializedName = @"actionName", PossibleTypes = new [] { typeof(string) })] @@ -84,14 +94,20 @@ public partial interface IDryrunPatch : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"the result of the dryrun", SerializedName = @"prerequisiteResults", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult[] PrerequisiteResult { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResult) })] + System.Collections.Generic.List PrerequisiteResult { get; } /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state. ", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] @@ -103,15 +119,15 @@ internal partial interface IDryrunPatchInternal { /// the preview of the operations for creation - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview[] OperationPreview { get; set; } + System.Collections.Generic.List OperationPreview { get; set; } /// The parameters of the dryrun - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParameters Parameter { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters Parameter { get; set; } /// The name of action for you dryrun job. string ParameterActionName { get; set; } /// the result of the dryrun - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult[] PrerequisiteResult { get; set; } + System.Collections.Generic.List PrerequisiteResult { get; set; } /// The properties of the dryrun job. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunProperties Property { get; set; } /// The provisioning state. string ProvisioningState { get; set; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunPatch.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunPatch.json.cs similarity index 94% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunPatch.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunPatch.json.cs index 4202bc00a4a8..fbd1138f892d 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunPatch.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunPatch.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -65,18 +65,18 @@ internal DryrunPatch(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Js { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunProperties.FromJson(__jsonProperties) : Property;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatch. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatch. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatch. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatch. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new DryrunPatch(json) : null; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunPrerequisiteResult.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunPrerequisiteResult.PowerShell.cs similarity index 77% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunPrerequisiteResult.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunPrerequisiteResult.PowerShell.cs index 9bf1362c45d9..92d63fe3f241 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunPrerequisiteResult.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunPrerequisiteResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,35 +55,41 @@ public partial class DryrunPrerequisiteResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DryrunPrerequisiteResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DryrunPrerequisiteResult(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,13 +104,13 @@ internal DryrunPrerequisiteResult(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResultInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPrerequisiteResultType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResultInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPrerequisiteResultType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResultInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResultInternal)this).Type, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -119,7 +125,7 @@ internal DryrunPrerequisiteResult(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResultInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPrerequisiteResultType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResultInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPrerequisiteResultType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResultInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResultInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -129,12 +135,24 @@ internal DryrunPrerequisiteResult(global::System.Management.Automation.PSObject /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// A result of dryrun [System.ComponentModel.TypeConverter(typeof(DryrunPrerequisiteResultTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunPrerequisiteResult.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunPrerequisiteResult.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunPrerequisiteResult.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunPrerequisiteResult.TypeConverter.cs index b7ebf9bad15b..e79eb9fdf58c 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunPrerequisiteResult.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunPrerequisiteResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunPrerequisiteResult.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunPrerequisiteResult.cs similarity index 70% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunPrerequisiteResult.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunPrerequisiteResult.cs index a78c7c860ec6..76d3568945a8 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunPrerequisiteResult.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunPrerequisiteResult.cs @@ -3,22 +3,22 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// A result of dryrun public partial class DryrunPrerequisiteResult : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResultInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResult, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResultInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPrerequisiteResultType _type; + private string _type; /// The type of dryrun result. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPrerequisiteResultType Type { get => this._type; set => this._type = value; } + public string Type { get => this._type; set => this._type = value; } /// Creates an new instance. public DryrunPrerequisiteResult() @@ -34,10 +34,14 @@ public partial interface IDryrunPrerequisiteResult : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of dryrun result.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPrerequisiteResultType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPrerequisiteResultType Type { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("basicError", "permissionsMissing")] + string Type { get; set; } } /// A result of dryrun @@ -45,7 +49,8 @@ internal partial interface IDryrunPrerequisiteResultInternal { /// The type of dryrun result. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPrerequisiteResultType Type { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("basicError", "permissionsMissing")] + string Type { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunPrerequisiteResult.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunPrerequisiteResult.json.cs similarity index 92% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunPrerequisiteResult.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunPrerequisiteResult.json.cs index e4c1e00dffa4..082dfd233bf9 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunPrerequisiteResult.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunPrerequisiteResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -65,20 +65,20 @@ internal DryrunPrerequisiteResult(Microsoft.Azure.PowerShell.Cmdlets.ServiceLink { return; } - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult. - /// Note: the Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult interface - /// is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the payload. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResult. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResult interface is polymorphic, + /// and the precise model class that will get deserialized is determined at runtime based on the payload. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { if (!(node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json)) { diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunProperties.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunProperties.PowerShell.cs similarity index 59% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunProperties.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunProperties.PowerShell.cs index bc086053421a..822c8808d26a 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunProperties.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,35 +55,41 @@ public partial class DryrunProperties partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DryrunProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DryrunProperties(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,29 +104,29 @@ internal DryrunProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Parameter")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParameters) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunParametersTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunParametersTypeConverter.ConvertFrom); } if (content.Contains("PrerequisiteResult")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)this).PrerequisiteResult = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult[]) content.GetValueForProperty("PrerequisiteResult",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)this).PrerequisiteResult, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunPrerequisiteResultTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)this).PrerequisiteResult = (System.Collections.Generic.List) content.GetValueForProperty("PrerequisiteResult",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)this).PrerequisiteResult, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunPrerequisiteResultTypeConverter.ConvertFrom)); } if (content.Contains("OperationPreview")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)this).OperationPreview = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview[]) content.GetValueForProperty("OperationPreview",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)this).OperationPreview, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunOperationPreviewTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)this).OperationPreview = (System.Collections.Generic.List) content.GetValueForProperty("OperationPreview",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)this).OperationPreview, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunOperationPreviewTypeConverter.ConvertFrom)); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("ParameterActionName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)this).ParameterActionName = (string) content.GetValueForProperty("ParameterActionName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)this).ParameterActionName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)this).ParameterActionName = (string) content.GetValueForProperty("ParameterActionName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)this).ParameterActionName, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -135,23 +141,23 @@ internal DryrunProperties(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Parameter")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParameters) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunParametersTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunParametersTypeConverter.ConvertFrom); } if (content.Contains("PrerequisiteResult")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)this).PrerequisiteResult = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult[]) content.GetValueForProperty("PrerequisiteResult",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)this).PrerequisiteResult, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunPrerequisiteResultTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)this).PrerequisiteResult = (System.Collections.Generic.List) content.GetValueForProperty("PrerequisiteResult",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)this).PrerequisiteResult, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunPrerequisiteResultTypeConverter.ConvertFrom)); } if (content.Contains("OperationPreview")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)this).OperationPreview = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview[]) content.GetValueForProperty("OperationPreview",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)this).OperationPreview, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunOperationPreviewTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)this).OperationPreview = (System.Collections.Generic.List) content.GetValueForProperty("OperationPreview",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)this).OperationPreview, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunOperationPreviewTypeConverter.ConvertFrom)); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("ParameterActionName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)this).ParameterActionName = (string) content.GetValueForProperty("ParameterActionName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal)this).ParameterActionName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)this).ParameterActionName = (string) content.GetValueForProperty("ParameterActionName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)this).ParameterActionName, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -161,12 +167,24 @@ internal DryrunProperties(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The properties of the dryrun job [System.ComponentModel.TypeConverter(typeof(DryrunPropertiesTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunProperties.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunProperties.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunProperties.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunProperties.TypeConverter.cs index db46669dff06..35196069f5f3 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunProperties.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunProperties.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunProperties.cs similarity index 61% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunProperties.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunProperties.cs index a346f5bf2a44..9e36a298e257 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunProperties.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunProperties.cs @@ -3,55 +3,55 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The properties of the dryrun job public partial class DryrunProperties : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunProperties, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunProperties, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal { /// Internal Acessors for OperationPreview - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview[] Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal.OperationPreview { get => this._operationPreview; set { {_operationPreview = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal.OperationPreview { get => this._operationPreview; set { {_operationPreview = value;} } } /// Internal Acessors for Parameter - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParameters Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal.Parameter { get => (this._parameter = this._parameter ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunParameters()); set { {_parameter = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal.Parameter { get => (this._parameter = this._parameter ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunParameters()); set { {_parameter = value;} } } /// Internal Acessors for ParameterActionName - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal.ParameterActionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParametersInternal)Parameter).ActionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParametersInternal)Parameter).ActionName = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal.ParameterActionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParametersInternal)Parameter).ActionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParametersInternal)Parameter).ActionName = value ?? null; } /// Internal Acessors for PrerequisiteResult - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult[] Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal.PrerequisiteResult { get => this._prerequisiteResult; set { {_prerequisiteResult = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal.PrerequisiteResult { get => this._prerequisiteResult; set { {_prerequisiteResult = value;} } } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview[] _operationPreview; + private System.Collections.Generic.List _operationPreview; /// the preview of the operations for creation [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview[] OperationPreview { get => this._operationPreview; } + public System.Collections.Generic.List OperationPreview { get => this._operationPreview; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParameters _parameter; + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters _parameter; /// The parameters of the dryrun [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParameters Parameter { get => (this._parameter = this._parameter ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunParameters()); set => this._parameter = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters Parameter { get => (this._parameter = this._parameter ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunParameters()); set => this._parameter = value; } /// The name of action for you dryrun job. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string ParameterActionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParametersInternal)Parameter).ActionName; } + public string ParameterActionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParametersInternal)Parameter).ActionName; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult[] _prerequisiteResult; + private System.Collections.Generic.List _prerequisiteResult; /// the result of the dryrun [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult[] PrerequisiteResult { get => this._prerequisiteResult; } + public System.Collections.Generic.List PrerequisiteResult { get => this._prerequisiteResult; } /// Backing field for property. private string _provisioningState; @@ -74,14 +74,20 @@ public partial interface IDryrunProperties : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"the preview of the operations for creation", SerializedName = @"operationPreviews", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview[] OperationPreview { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreview) })] + System.Collections.Generic.List OperationPreview { get; } /// The name of action for you dryrun job. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = true, + Update = true, Description = @"The name of action for you dryrun job.", SerializedName = @"actionName", PossibleTypes = new [] { typeof(string) })] @@ -90,14 +96,20 @@ public partial interface IDryrunProperties : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"the result of the dryrun", SerializedName = @"prerequisiteResults", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult[] PrerequisiteResult { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResult) })] + System.Collections.Generic.List PrerequisiteResult { get; } /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state. ", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] @@ -109,13 +121,13 @@ internal partial interface IDryrunPropertiesInternal { /// the preview of the operations for creation - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview[] OperationPreview { get; set; } + System.Collections.Generic.List OperationPreview { get; set; } /// The parameters of the dryrun - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunParameters Parameter { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters Parameter { get; set; } /// The name of action for you dryrun job. string ParameterActionName { get; set; } /// the result of the dryrun - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult[] PrerequisiteResult { get; set; } + System.Collections.Generic.List PrerequisiteResult { get; set; } /// The provisioning state. string ProvisioningState { get; set; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunProperties.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunProperties.json.cs similarity index 86% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunProperties.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunProperties.json.cs index a88407e584df..a2db2c11f386 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunProperties.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -65,21 +65,21 @@ internal DryrunProperties(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runti { return; } - {_parameter = If( json?.PropertyT("parameters"), out var __jsonParameters) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunParameters.FromJson(__jsonParameters) : Parameter;} - {_prerequisiteResult = If( json?.PropertyT("prerequisiteResults"), out var __jsonPrerequisiteResults) ? If( __jsonPrerequisiteResults as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult) (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunPrerequisiteResult.FromJson(__u) )) ))() : null : PrerequisiteResult;} - {_operationPreview = If( json?.PropertyT("operationPreviews"), out var __jsonOperationPreviews) ? If( __jsonOperationPreviews as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Models.Api20221101Preview.IDryrunOperationPreview) (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunOperationPreview.FromJson(__p) )) ))() : null : OperationPreview;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_parameter = If( json?.PropertyT("parameters"), out var __jsonParameters) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunParameters.FromJson(__jsonParameters) : _parameter;} + {_prerequisiteResult = If( json?.PropertyT("prerequisiteResults"), out var __jsonPrerequisiteResults) ? If( __jsonPrerequisiteResults as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResult) (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunPrerequisiteResult.FromJson(__u) )) ))() : null : _prerequisiteResult;} + {_operationPreview = If( json?.PropertyT("operationPreviews"), out var __jsonOperationPreviews) ? If( __jsonOperationPreviews as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreview) (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunOperationPreview.FromJson(__p) )) ))() : null : _operationPreview;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new DryrunProperties(json) : null; } @@ -104,7 +104,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode To return container; } AddIf( null != this._parameter ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) this._parameter.ToJson(null,serializationMode) : null, "parameters" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeRead)) { if (null != this._prerequisiteResult) { @@ -116,7 +116,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode To container.Add("prerequisiteResults",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeRead)) { if (null != this._operationPreview) { @@ -128,7 +128,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode To container.Add("operationPreviews",__r); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunResource.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunResource.PowerShell.cs new file mode 100644 index 000000000000..ffda3588e220 --- /dev/null +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunResource.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.ServiceLinker.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + + /// a dryrun job resource + [System.ComponentModel.TypeConverter(typeof(DryrunResourceTypeConverter))] + public partial class DryrunResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DryrunResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DryrunResource(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DryrunResource(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.ServiceLinker.Models.IDryrunResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Parameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunParametersTypeConverter.ConvertFrom); + } + if (content.Contains("PrerequisiteResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal)this).PrerequisiteResult = (System.Collections.Generic.List) content.GetValueForProperty("PrerequisiteResult",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal)this).PrerequisiteResult, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunPrerequisiteResultTypeConverter.ConvertFrom)); + } + if (content.Contains("OperationPreview")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal)this).OperationPreview = (System.Collections.Generic.List) content.GetValueForProperty("OperationPreview",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal)this).OperationPreview, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunOperationPreviewTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ParameterActionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal)this).ParameterActionName = (string) content.GetValueForProperty("ParameterActionName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal)this).ParameterActionName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DryrunResource(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.ServiceLinker.Models.IDryrunResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Parameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunParametersTypeConverter.ConvertFrom); + } + if (content.Contains("PrerequisiteResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal)this).PrerequisiteResult = (System.Collections.Generic.List) content.GetValueForProperty("PrerequisiteResult",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal)this).PrerequisiteResult, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunPrerequisiteResultTypeConverter.ConvertFrom)); + } + if (content.Contains("OperationPreview")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal)this).OperationPreview = (System.Collections.Generic.List) content.GetValueForProperty("OperationPreview",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal)this).OperationPreview, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunOperationPreviewTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ParameterActionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal)this).ParameterActionName = (string) content.GetValueForProperty("ParameterActionName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal)this).ParameterActionName, 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.ServiceLinker.Models.IDryrunResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// a dryrun job resource + [System.ComponentModel.TypeConverter(typeof(DryrunResourceTypeConverter))] + public partial interface IDryrunResource + + { + + } +} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunResource.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunResource.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunResource.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunResource.TypeConverter.cs index a226e78f2ee5..da1315bdd025 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunResource.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunResource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunResource.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunResource.cs new file mode 100644 index 000000000000..b7bc3e2e3278 --- /dev/null +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunResource.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.ServiceLinker.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + + /// a dryrun job resource + public partial class DryrunResource : + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ProxyResource(); + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).Id; } + + /// Internal Acessors for OperationPreview + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal.OperationPreview { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).OperationPreview; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).OperationPreview = value ?? null /* arrayOf */; } + + /// Internal Acessors for Parameter + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal.Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).Parameter = value ?? null /* model class */; } + + /// Internal Acessors for ParameterActionName + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal.ParameterActionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).ParameterActionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).ParameterActionName = value ?? null; } + + /// Internal Acessors for PrerequisiteResult + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal.PrerequisiteResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).PrerequisiteResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).PrerequisiteResult = value ?? null /* arrayOf */; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunProperties Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResourceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).ProvisioningState = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).Id = value ?? null; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).Name = value ?? null; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedByType = value ?? null; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).Type = value ?? null; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).Name; } + + /// the preview of the operations for creation + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] + public System.Collections.Generic.List OperationPreview { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).OperationPreview; } + + /// The parameters of the dryrun + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).Parameter = value ?? null /* model class */; } + + /// The name of action for you dryrun job. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] + public string ParameterActionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).ParameterActionName; } + + /// the result of the dryrun + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] + public System.Collections.Generic.List PrerequisiteResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).PrerequisiteResult; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunProperties _property; + + /// The properties of the dryrun job. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunProperties()); set => this._property = value; } + + /// The provisioning state. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPropertiesInternal)Property).ProvisioningState; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemData = value ?? null /* model class */; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataCreatedAt; } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataCreatedBy; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataCreatedByType; } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedAt; } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedBy; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedByType; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).Type; } + + /// Creates an new instance. + public DryrunResource() + { + + } + + /// 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.ServiceLinker.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); + } + } + /// a dryrun job resource + public partial interface IDryrunResource : + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IProxyResource + { + /// the preview of the operations for creation + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"the preview of the operations for creation", + SerializedName = @"operationPreviews", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunOperationPreview) })] + System.Collections.Generic.List OperationPreview { get; } + /// The name of action for you dryrun job. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = true, + Update = true, + Description = @"The name of action for you dryrun job.", + SerializedName = @"actionName", + PossibleTypes = new [] { typeof(string) })] + string ParameterActionName { get; } + /// the result of the dryrun + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"the result of the dryrun", + SerializedName = @"prerequisiteResults", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResult) })] + System.Collections.Generic.List PrerequisiteResult { get; } + /// The provisioning state. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state. ", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + + } + /// a dryrun job resource + internal partial interface IDryrunResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IProxyResourceInternal + { + /// the preview of the operations for creation + System.Collections.Generic.List OperationPreview { get; set; } + /// The parameters of the dryrun + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunParameters Parameter { get; set; } + /// The name of action for you dryrun job. + string ParameterActionName { get; set; } + /// the result of the dryrun + System.Collections.Generic.List PrerequisiteResult { get; set; } + /// The properties of the dryrun job. + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunProperties Property { get; set; } + /// The provisioning state. + string ProvisioningState { get; set; } + + } +} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunResource.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunResource.json.cs similarity index 92% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunResource.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunResource.json.cs index 6b3dff56a8f8..efbeafab836f 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/DryrunResource.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/DryrunResource.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -65,19 +65,19 @@ internal DryrunResource(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunProperties.FromJson(__jsonProperties) : Property;} + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new DryrunResource(json) : null; } @@ -101,7 +101,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode To { return container; } - __resource?.ToJson(container, serializationMode); + __proxyResource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); AfterToJson(ref container); return container; diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorAdditionalInfo.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorAdditionalInfo.PowerShell.cs similarity index 73% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorAdditionalInfo.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorAdditionalInfo.PowerShell.cs index d1286b7370eb..947f47668dc9 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorAdditionalInfo.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorAdditionalInfo.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class ErrorAdditionalInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorAdditionalInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorAdditionalInfo(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorAdditionalInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorAdditionalInfo(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,17 +104,17 @@ internal ErrorAdditionalInfo(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Info")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AnyTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -121,11 +129,11 @@ internal ErrorAdditionalInfo(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Info")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AnyTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -135,12 +143,24 @@ internal ErrorAdditionalInfo(global::System.Management.Automation.PSObject conte /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorAdditionalInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The resource management error additional info. [System.ComponentModel.TypeConverter(typeof(ErrorAdditionalInfoTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorAdditionalInfo.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorAdditionalInfo.TypeConverter.cs similarity index 98% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorAdditionalInfo.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorAdditionalInfo.TypeConverter.cs index 962053db83ae..dead1a2462bc 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorAdditionalInfo.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorAdditionalInfo.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorAdditionalInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorAdditionalInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorAdditionalInfo.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorAdditionalInfo.cs similarity index 86% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorAdditionalInfo.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorAdditionalInfo.cs index 1a45eaa7022b..dd91bf4f8e13 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorAdditionalInfo.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorAdditionalInfo.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The resource management error additional info. public partial class ErrorAdditionalInfo : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfo, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorAdditionalInfo, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorAdditionalInfoInternal { /// Backing field for property. @@ -21,10 +21,10 @@ public partial class ErrorAdditionalInfo : public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAny Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Any()); } /// Internal Acessors for Info - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAny Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfoInternal.Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Any()); set { {_info = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAny Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorAdditionalInfoInternal.Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Any()); set { {_info = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfoInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorAdditionalInfoInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _type; @@ -47,6 +47,9 @@ public partial interface IErrorAdditionalInfo : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The additional info.", SerializedName = @"info", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAny) })] @@ -55,6 +58,9 @@ public partial interface IErrorAdditionalInfo : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The additional info type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorAdditionalInfo.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorAdditionalInfo.json.cs similarity index 95% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorAdditionalInfo.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorAdditionalInfo.json.cs index 94e103476241..2bed8b8f7c34 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorAdditionalInfo.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorAdditionalInfo.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ErrorAdditionalInfo(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Ru { 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.ServiceLinker.Models.Any.FromJson(__jsonInfo) : Info;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_info = If( json?.PropertyT("info"), out var __jsonInfo) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Any.FromJson(__jsonInfo) : _info;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorAdditionalInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorAdditionalInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorAdditionalInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new ErrorAdditionalInfo(json) : null; } @@ -101,11 +101,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode To { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._info ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) this._info.ToJson(null,serializationMode) : null, "info" ,container.Add ); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorDetail.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorDetail.PowerShell.cs similarity index 62% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorDetail.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorDetail.PowerShell.cs index da49fba40996..f78c7ddcb5ce 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorDetail.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorDetail.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class ErrorDetail partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorDetail(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorDetail(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,29 +104,29 @@ internal ErrorDetail(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorDetailTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorDetailTypeConverter.ConvertFrom)); } if (content.Contains("AdditionalInfo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -133,23 +141,23 @@ internal ErrorDetail(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorDetailTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorDetailTypeConverter.ConvertFrom)); } if (content.Contains("AdditionalInfo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -159,12 +167,24 @@ internal ErrorDetail(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The error detail. [System.ComponentModel.TypeConverter(typeof(ErrorDetailTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorDetail.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorDetail.TypeConverter.cs similarity index 98% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorDetail.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorDetail.TypeConverter.cs index 4e18ea4996b2..e213b4ecaf1c 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorDetail.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorDetail.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetail ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetail).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorDetail.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorDetail.cs similarity index 68% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorDetail.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorDetail.cs index ef277fa786e6..6f8774587ede 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorDetail.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorDetail.cs @@ -3,22 +3,22 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The error detail. public partial class ErrorDetail : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetail, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfo[] _additionalInfo; + private System.Collections.Generic.List _additionalInfo; /// The error additional info. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfo[] AdditionalInfo { get => this._additionalInfo; } + public System.Collections.Generic.List AdditionalInfo { get => this._additionalInfo; } /// Backing field for property. private string _code; @@ -28,11 +28,11 @@ public partial class ErrorDetail : public string Code { get => this._code; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail[] _detail; + private System.Collections.Generic.List _detail; /// The error details. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail[] Detail { get => this._detail; } + public System.Collections.Generic.List Detail { get => this._detail; } /// Backing field for property. private string _message; @@ -42,19 +42,19 @@ public partial class ErrorDetail : public string Message { get => this._message; } /// Internal Acessors for AdditionalInfo - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal.AdditionalInfo { get => this._additionalInfo; set { {_additionalInfo = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal.AdditionalInfo { get => this._additionalInfo; set { {_additionalInfo = value;} } } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal.Code { get => this._code; set { {_code = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal.Code { get => this._code; set { {_code = value;} } } /// Internal Acessors for Detail - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail[] Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal.Detail { get => this._detail; set { {_detail = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal.Detail { get => this._detail; set { {_detail = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal.Message { get => this._message; set { {_message = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal.Message { get => this._message; set { {_message = value;} } } /// Internal Acessors for Target - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal.Target { get => this._target; set { {_target = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal.Target { get => this._target; set { {_target = value;} } } /// Backing field for property. private string _target; @@ -77,14 +77,20 @@ public partial interface IErrorDetail : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error additional info.", SerializedName = @"additionalInfo", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfo) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfo[] AdditionalInfo { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorAdditionalInfo) })] + System.Collections.Generic.List AdditionalInfo { get; } /// The error code. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -93,14 +99,20 @@ public partial interface IErrorDetail : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error details.", SerializedName = @"details", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail[] Detail { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetail) })] + System.Collections.Generic.List Detail { get; } /// The error message. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error message.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -109,6 +121,9 @@ public partial interface IErrorDetail : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error target.", SerializedName = @"target", PossibleTypes = new [] { typeof(string) })] @@ -120,11 +135,11 @@ internal partial interface IErrorDetailInternal { /// The error additional info. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfo[] AdditionalInfo { get; set; } + System.Collections.Generic.List AdditionalInfo { get; set; } /// The error code. string Code { get; set; } /// The error details. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail[] Detail { get; set; } + System.Collections.Generic.List Detail { get; set; } /// The error message. string Message { get; set; } /// The error target. diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorDetail.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorDetail.json.cs similarity index 87% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorDetail.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorDetail.json.cs index 4ebe0bda51d3..4aa99de15dc8 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorDetail.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorDetail.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -65,22 +65,22 @@ internal ErrorDetail(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Js { 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.ServiceLinker.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.ServiceLinker.Models.Api30.IErrorDetail) (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorDetail.FromJson(__u) )) ))() : null : Detail;} - {_additionalInfo = If( json?.PropertyT("additionalInfo"), out var __jsonAdditionalInfo) ? If( __jsonAdditionalInfo as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Models.Api30.IErrorAdditionalInfo) (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorAdditionalInfo.FromJson(__p) )) ))() : null : AdditionalInfo;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} + {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)_target;} + {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? If( __jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetail) (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorDetail.FromJson(__u) )) ))() : null : _detail;} + {_additionalInfo = If( json?.PropertyT("additionalInfo"), out var __jsonAdditionalInfo) ? If( __jsonAdditionalInfo as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorAdditionalInfo) (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorAdditionalInfo.FromJson(__p) )) ))() : null : _additionalInfo;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetail. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetail. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new ErrorDetail(json) : null; } @@ -104,19 +104,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode To { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._target)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString(this._target.ToString()) : null, "target" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeRead)) { if (null != this._detail) { @@ -128,7 +128,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode To container.Add("details",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeRead)) { if (null != this._additionalInfo) { diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorResponse.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs similarity index 61% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorResponse.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs index 33736ae0469e..dc96faf00256 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorResponse.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -58,33 +58,41 @@ public partial class ErrorResponse partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorResponse(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorResponse(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -99,33 +107,33 @@ internal ErrorResponse(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorDetailTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorDetailTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorDetailTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorDetailTypeConverter.ConvertFrom)); } if (content.Contains("AdditionalInfo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -140,27 +148,27 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorDetailTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorDetailTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorDetailTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorDetailTypeConverter.ConvertFrom)); } if (content.Contains("AdditionalInfo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -170,12 +178,24 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows /// the OData error response format.). diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorResponse.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs similarity index 98% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorResponse.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs index 5dc1b6360284..cf1f3b77069a 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorResponse.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorResponse.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorResponse.cs similarity index 60% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorResponse.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorResponse.cs index 4add55ab3058..01a58f52676c 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorResponse.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorResponse.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -12,54 +12,54 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 /// the OData error response format.). /// public partial class ErrorResponse : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal { /// The error additional info. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfo[] AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)Error).AdditionalInfo; } + public System.Collections.Generic.List AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)Error).AdditionalInfo; } /// The error code. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)Error).Code; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)Error).Code; } /// The error details. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)Error).Detail; } + public System.Collections.Generic.List Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)Error).Detail; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail _error; + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetail _error; /// The error object. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorDetail()); set => this._error = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetail Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorDetail()); set => this._error = value; } /// The error message. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)Error).Message; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)Error).Message; } /// Internal Acessors for AdditionalInfo - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)Error).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)Error).AdditionalInfo = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)Error).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)Error).AdditionalInfo = value ?? null /* arrayOf */; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)Error).Code = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)Error).Code = value ?? null; } /// Internal Acessors for Detail - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail[] Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)Error).Detail = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)Error).Detail = value ?? null /* arrayOf */; } /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorDetail()); set { {_error = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetail Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorDetail()); set { {_error = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)Error).Message = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)Error).Message = value ?? null; } /// Internal Acessors for Target - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponseInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)Error).Target = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponseInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)Error).Target = value ?? null; } /// The error target. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetailInternal)Error).Target; } + public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetailInternal)Error).Target; } /// Creates an new instance. public ErrorResponse() @@ -76,14 +76,20 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error additional info.", SerializedName = @"additionalInfo", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfo) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfo[] AdditionalInfo { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorAdditionalInfo) })] + System.Collections.Generic.List AdditionalInfo { get; } /// The error code. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -92,14 +98,20 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error details.", SerializedName = @"details", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail[] Detail { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetail) })] + System.Collections.Generic.List Detail { get; } /// The error message. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error message.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -108,6 +120,9 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error target.", SerializedName = @"target", PossibleTypes = new [] { typeof(string) })] @@ -120,13 +135,13 @@ internal partial interface IErrorResponseInternal { /// The error additional info. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorAdditionalInfo[] AdditionalInfo { get; set; } + System.Collections.Generic.List AdditionalInfo { get; set; } /// The error code. string Code { get; set; } /// The error details. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail[] Detail { get; set; } + System.Collections.Generic.List Detail { get; set; } /// The error object. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorDetail Error { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorDetail Error { get; set; } /// The error message. string Message { get; set; } /// The error target. diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorResponse.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorResponse.json.cs similarity index 95% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorResponse.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorResponse.json.cs index 0cb3fafbfe45..c7c73450d33c 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ErrorResponse.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ErrorResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -68,18 +68,18 @@ internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime. { return; } - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorDetail.FromJson(__jsonError) : Error;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorDetail.FromJson(__jsonError) : _error;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new ErrorResponse(json) : null; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/FirewallRules.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/FirewallRules.PowerShell.cs similarity index 70% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/FirewallRules.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/FirewallRules.PowerShell.cs index 7d38d3daa5f8..fcd0dc1b0d38 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/FirewallRules.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/FirewallRules.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class FirewallRules partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new FirewallRules(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new FirewallRules(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,21 +104,21 @@ internal FirewallRules(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("IPRange")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRulesInternal)this).IPRange = (string[]) content.GetValueForProperty("IPRange",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRulesInternal)this).IPRange, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRulesInternal)this).IPRange = (System.Collections.Generic.List) content.GetValueForProperty("IPRange",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRulesInternal)this).IPRange, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("AzureService")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRulesInternal)this).AzureService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType?) content.GetValueForProperty("AzureService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRulesInternal)this).AzureService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRulesInternal)this).AzureService = (string) content.GetValueForProperty("AzureService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRulesInternal)this).AzureService, global::System.Convert.ToString); } if (content.Contains("CallerClientIP")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRulesInternal)this).CallerClientIP = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType?) content.GetValueForProperty("CallerClientIP",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRulesInternal)this).CallerClientIP, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRulesInternal)this).CallerClientIP = (string) content.GetValueForProperty("CallerClientIP",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRulesInternal)this).CallerClientIP, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -125,15 +133,15 @@ internal FirewallRules(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("IPRange")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRulesInternal)this).IPRange = (string[]) content.GetValueForProperty("IPRange",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRulesInternal)this).IPRange, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRulesInternal)this).IPRange = (System.Collections.Generic.List) content.GetValueForProperty("IPRange",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRulesInternal)this).IPRange, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("AzureService")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRulesInternal)this).AzureService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType?) content.GetValueForProperty("AzureService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRulesInternal)this).AzureService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRulesInternal)this).AzureService = (string) content.GetValueForProperty("AzureService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRulesInternal)this).AzureService, global::System.Convert.ToString); } if (content.Contains("CallerClientIP")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRulesInternal)this).CallerClientIP = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType?) content.GetValueForProperty("CallerClientIP",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRulesInternal)this).CallerClientIP, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRulesInternal)this).CallerClientIP = (string) content.GetValueForProperty("CallerClientIP",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRulesInternal)this).CallerClientIP, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -143,12 +151,24 @@ internal FirewallRules(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Target service's firewall rules. to allow connections from source service. [System.ComponentModel.TypeConverter(typeof(FirewallRulesTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/FirewallRules.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/FirewallRules.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/FirewallRules.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/FirewallRules.TypeConverter.cs index 9b25a2ea4231..61bfdad4cacc 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/FirewallRules.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/FirewallRules.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/FirewallRules.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/FirewallRules.cs similarity index 73% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/FirewallRules.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/FirewallRules.cs index 8b5bb2f7f36b..b4d4d7519ee6 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/FirewallRules.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/FirewallRules.cs @@ -3,42 +3,42 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// Target service's firewall rules. to allow connections from source service. public partial class FirewallRules : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRulesInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRulesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? _azureService; + private string _azureService; /// Allow Azure services to access the target service if true. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? AzureService { get => this._azureService; set => this._azureService = value; } + public string AzureService { get => this._azureService; set => this._azureService = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? _callerClientIP; + private string _callerClientIP; /// /// Allow caller client IP to access the target service if true. the property is used when connecting local application to /// target service. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? CallerClientIP { get => this._callerClientIP; set => this._callerClientIP = value; } + public string CallerClientIP { get => this._callerClientIP; set => this._callerClientIP = value; } /// Backing field for property. - private string[] _iPRange; + private System.Collections.Generic.List _iPRange; /// /// This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client /// IPs for a given database account. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public string[] IPRange { get => this._iPRange; set => this._iPRange = value; } + public System.Collections.Generic.List IPRange { get => this._iPRange; set => this._iPRange = value; } /// Creates an new instance. public FirewallRules() @@ -54,10 +54,14 @@ public partial interface IFirewallRules : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Allow Azure services to access the target service if true.", SerializedName = @"azureServices", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? AzureService { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + string AzureService { get; set; } /// /// Allow caller client IP to access the target service if true. the property is used when connecting local application to /// target service. @@ -65,10 +69,14 @@ public partial interface IFirewallRules : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Allow caller client IP to access the target service if true. the property is used when connecting local application to target service.", SerializedName = @"callerClientIP", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? CallerClientIP { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + string CallerClientIP { get; set; } /// /// This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client /// IPs for a given database account. @@ -76,10 +84,13 @@ public partial interface IFirewallRules : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account.", SerializedName = @"ipRanges", PossibleTypes = new [] { typeof(string) })] - string[] IPRange { get; set; } + System.Collections.Generic.List IPRange { get; set; } } /// Target service's firewall rules. to allow connections from source service. @@ -87,17 +98,19 @@ internal partial interface IFirewallRulesInternal { /// Allow Azure services to access the target service if true. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? AzureService { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + string AzureService { get; set; } /// /// Allow caller client IP to access the target service if true. the property is used when connecting local application to /// target service. /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? CallerClientIP { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + string CallerClientIP { get; set; } /// /// This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client /// IPs for a given database account. /// - string[] IPRange { get; set; } + System.Collections.Generic.List IPRange { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/FirewallRules.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/FirewallRules.json.cs similarity index 92% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/FirewallRules.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/FirewallRules.json.cs index 10069c89cd5e..b94be89afc00 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/FirewallRules.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/FirewallRules.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -65,20 +65,20 @@ internal FirewallRules(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime. { return; } - {_iPRange = If( json?.PropertyT("ipRanges"), out var __jsonIPRanges) ? If( __jsonIPRanges as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : IPRange;} - {_azureService = If( json?.PropertyT("azureServices"), out var __jsonAzureServices) ? (string)__jsonAzureServices : (string)AzureService;} - {_callerClientIP = If( json?.PropertyT("callerClientIP"), out var __jsonCallerClientIP) ? (string)__jsonCallerClientIP : (string)CallerClientIP;} + {_iPRange = If( json?.PropertyT("ipRanges"), out var __jsonIPRanges) ? If( __jsonIPRanges as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _iPRange;} + {_azureService = If( json?.PropertyT("azureServices"), out var __jsonAzureServices) ? (string)__jsonAzureServices : (string)_azureService;} + {_callerClientIP = If( json?.PropertyT("callerClientIP"), out var __jsonCallerClientIP) ? (string)__jsonCallerClientIP : (string)_callerClientIP;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new FirewallRules(json) : null; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/KeyVaultSecretReferenceSecretInfo.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/KeyVaultSecretReferenceSecretInfo.PowerShell.cs similarity index 72% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/KeyVaultSecretReferenceSecretInfo.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/KeyVaultSecretReferenceSecretInfo.PowerShell.cs index 7bf2b0a8b4e9..5aae198ec00f 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/KeyVaultSecretReferenceSecretInfo.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/KeyVaultSecretReferenceSecretInfo.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -58,29 +58,37 @@ public partial class KeyVaultSecretReferenceSecretInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretReferenceSecretInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretReferenceSecretInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new KeyVaultSecretReferenceSecretInfo(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretReferenceSecretInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretReferenceSecretInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new KeyVaultSecretReferenceSecretInfo(content); } @@ -92,10 +100,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretReferenceSecretInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretReferenceSecretInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -110,21 +118,21 @@ internal KeyVaultSecretReferenceSecretInfo(global::System.Collections.IDictionar // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretReferenceSecretInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretReferenceSecretInfoInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretReferenceSecretInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretReferenceSecretInfoInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Version")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretReferenceSecretInfoInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretReferenceSecretInfoInternal)this).Version, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretReferenceSecretInfoInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretReferenceSecretInfoInternal)this).Version, global::System.Convert.ToString); } if (content.Contains("SecretType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBaseInternal)this).SecretType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType) content.GetValueForProperty("SecretType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBaseInternal)this).SecretType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBaseInternal)this).SecretType = (string) content.GetValueForProperty("SecretType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBaseInternal)this).SecretType, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -139,15 +147,15 @@ internal KeyVaultSecretReferenceSecretInfo(global::System.Management.Automation. // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretReferenceSecretInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretReferenceSecretInfoInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretReferenceSecretInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretReferenceSecretInfoInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Version")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretReferenceSecretInfoInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretReferenceSecretInfoInternal)this).Version, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretReferenceSecretInfoInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretReferenceSecretInfoInternal)this).Version, global::System.Convert.ToString); } if (content.Contains("SecretType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBaseInternal)this).SecretType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType) content.GetValueForProperty("SecretType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBaseInternal)this).SecretType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBaseInternal)this).SecretType = (string) content.GetValueForProperty("SecretType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBaseInternal)this).SecretType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -156,6 +164,18 @@ internal KeyVaultSecretReferenceSecretInfo(global::System.Management.Automation. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The secret info when type is keyVaultSecretReference. It's for scenario that user provides a secret stored in user's keyvault /// and source is Azure Kubernetes. The key Vault's resource id is linked to secretStore.keyVaultId. diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/KeyVaultSecretReferenceSecretInfo.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/KeyVaultSecretReferenceSecretInfo.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/KeyVaultSecretReferenceSecretInfo.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/KeyVaultSecretReferenceSecretInfo.TypeConverter.cs index 7c0fcf7a42ec..7d96e589fbaf 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/KeyVaultSecretReferenceSecretInfo.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/KeyVaultSecretReferenceSecretInfo.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretReferenceSecretInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretReferenceSecretInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretReferenceSecretInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretReferenceSecretInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/KeyVaultSecretReferenceSecretInfo.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/KeyVaultSecretReferenceSecretInfo.cs similarity index 85% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/KeyVaultSecretReferenceSecretInfo.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/KeyVaultSecretReferenceSecretInfo.cs index e128037d0fbe..8c21aa20b2ca 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/KeyVaultSecretReferenceSecretInfo.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/KeyVaultSecretReferenceSecretInfo.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -12,15 +12,15 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Pre /// and source is Azure Kubernetes. The key Vault's resource id is linked to secretStore.keyVaultId. /// public partial class KeyVaultSecretReferenceSecretInfo : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretReferenceSecretInfo, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretReferenceSecretInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretReferenceSecretInfo, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretReferenceSecretInfoInternal, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBase __secretInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretInfoBase(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBase __secretInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretInfoBase(); /// Backing field for property. private string _name; @@ -30,8 +30,9 @@ public partial class KeyVaultSecretReferenceSecretInfo : public string Name { get => this._name; set => this._name = value; } /// The secret type. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Constant] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType SecretType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBaseInternal)__secretInfoBase).SecretType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBaseInternal)__secretInfoBase).SecretType = value ; } + public string SecretType { get => "keyVaultSecretReference"; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBaseInternal)__secretInfoBase).SecretType = "keyVaultSecretReference"; } /// Backing field for property. private string _version; @@ -43,7 +44,7 @@ public partial class KeyVaultSecretReferenceSecretInfo : /// Creates an new instance. public KeyVaultSecretReferenceSecretInfo() { - + this.__secretInfoBase.SecretType = "keyVaultSecretReference"; } /// Validates that this object meets the validation criteria. @@ -62,12 +63,15 @@ public KeyVaultSecretReferenceSecretInfo() /// and source is Azure Kubernetes. The key Vault's resource id is linked to secretStore.keyVaultId. public partial interface IKeyVaultSecretReferenceSecretInfo : Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBase + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBase { /// Name of the Key Vault secret. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the Key Vault secret.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -76,6 +80,9 @@ public partial interface IKeyVaultSecretReferenceSecretInfo : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Version of the Key Vault secret.", SerializedName = @"version", PossibleTypes = new [] { typeof(string) })] @@ -85,7 +92,7 @@ public partial interface IKeyVaultSecretReferenceSecretInfo : /// The secret info when type is keyVaultSecretReference. It's for scenario that user provides a secret stored in user's keyvault /// and source is Azure Kubernetes. The key Vault's resource id is linked to secretStore.keyVaultId. internal partial interface IKeyVaultSecretReferenceSecretInfoInternal : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBaseInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBaseInternal { /// Name of the Key Vault secret. string Name { get; set; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/KeyVaultSecretReferenceSecretInfo.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/KeyVaultSecretReferenceSecretInfo.json.cs similarity index 93% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/KeyVaultSecretReferenceSecretInfo.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/KeyVaultSecretReferenceSecretInfo.json.cs index f7a8db5ab46d..839d0c68aa15 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/KeyVaultSecretReferenceSecretInfo.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/KeyVaultSecretReferenceSecretInfo.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -57,13 +57,13 @@ public partial class KeyVaultSecretReferenceSecretInfo partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretReferenceSecretInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretReferenceSecretInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretReferenceSecretInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretReferenceSecretInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretReferenceSecretInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretReferenceSecretInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new KeyVaultSecretReferenceSecretInfo(json) : null; } @@ -80,9 +80,9 @@ internal KeyVaultSecretReferenceSecretInfo(Microsoft.Azure.PowerShell.Cmdlets.Se { return; } - __secretInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretInfoBase(json); - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)Version;} + __secretInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretInfoBase(json); + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)_version;} AfterFromJson(json); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/KeyVaultSecretUriSecretInfo.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/KeyVaultSecretUriSecretInfo.PowerShell.cs similarity index 74% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/KeyVaultSecretUriSecretInfo.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/KeyVaultSecretUriSecretInfo.PowerShell.cs index b0eaed62ecd7..eca2d923960c 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/KeyVaultSecretUriSecretInfo.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/KeyVaultSecretUriSecretInfo.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -58,29 +58,35 @@ public partial class KeyVaultSecretUriSecretInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretUriSecretInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretUriSecretInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new KeyVaultSecretUriSecretInfo(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretUriSecretInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretUriSecretInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new KeyVaultSecretUriSecretInfo(content); } @@ -90,10 +96,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretUriSecretInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretUriSecretInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -108,17 +114,17 @@ internal KeyVaultSecretUriSecretInfo(global::System.Collections.IDictionary cont // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretUriSecretInfoInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretUriSecretInfoInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretUriSecretInfoInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretUriSecretInfoInternal)this).Value, global::System.Convert.ToString); } if (content.Contains("SecretType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBaseInternal)this).SecretType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType) content.GetValueForProperty("SecretType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBaseInternal)this).SecretType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBaseInternal)this).SecretType = (string) content.GetValueForProperty("SecretType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBaseInternal)this).SecretType, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -133,11 +139,11 @@ internal KeyVaultSecretUriSecretInfo(global::System.Management.Automation.PSObje // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretUriSecretInfoInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretUriSecretInfoInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretUriSecretInfoInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretUriSecretInfoInternal)this).Value, global::System.Convert.ToString); } if (content.Contains("SecretType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBaseInternal)this).SecretType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType) content.GetValueForProperty("SecretType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBaseInternal)this).SecretType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBaseInternal)this).SecretType = (string) content.GetValueForProperty("SecretType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBaseInternal)this).SecretType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -146,6 +152,18 @@ internal KeyVaultSecretUriSecretInfo(global::System.Management.Automation.PSObje /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The secret info when type is keyVaultSecretUri. It's for scenario that user provides a secret stored in user's keyvault /// and source is Web App, Spring Cloud or Container App. diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/KeyVaultSecretUriSecretInfo.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/KeyVaultSecretUriSecretInfo.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/KeyVaultSecretUriSecretInfo.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/KeyVaultSecretUriSecretInfo.TypeConverter.cs index bd91ad29b618..d4c73e4ba66d 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/KeyVaultSecretUriSecretInfo.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/KeyVaultSecretUriSecretInfo.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretUriSecretInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretUriSecretInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretUriSecretInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretUriSecretInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/KeyVaultSecretUriSecretInfo.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/KeyVaultSecretUriSecretInfo.cs similarity index 82% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/KeyVaultSecretUriSecretInfo.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/KeyVaultSecretUriSecretInfo.cs index 03beffae7290..ec494e400aba 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/KeyVaultSecretUriSecretInfo.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/KeyVaultSecretUriSecretInfo.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -12,19 +12,20 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Pre /// and source is Web App, Spring Cloud or Container App. /// public partial class KeyVaultSecretUriSecretInfo : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretUriSecretInfo, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretUriSecretInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretUriSecretInfo, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretUriSecretInfoInternal, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBase __secretInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretInfoBase(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBase __secretInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretInfoBase(); /// The secret type. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Constant] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType SecretType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBaseInternal)__secretInfoBase).SecretType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBaseInternal)__secretInfoBase).SecretType = value ; } + public string SecretType { get => "keyVaultSecretUri"; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBaseInternal)__secretInfoBase).SecretType = "keyVaultSecretUri"; } /// Backing field for property. private string _value; @@ -36,7 +37,7 @@ public partial class KeyVaultSecretUriSecretInfo : /// Creates an new instance. public KeyVaultSecretUriSecretInfo() { - + this.__secretInfoBase.SecretType = "keyVaultSecretUri"; } /// Validates that this object meets the validation criteria. @@ -55,12 +56,15 @@ public KeyVaultSecretUriSecretInfo() /// and source is Web App, Spring Cloud or Container App. public partial interface IKeyVaultSecretUriSecretInfo : Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBase + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBase { /// URI to the keyvault secret [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"URI to the keyvault secret", SerializedName = @"value", PossibleTypes = new [] { typeof(string) })] @@ -70,7 +74,7 @@ public partial interface IKeyVaultSecretUriSecretInfo : /// The secret info when type is keyVaultSecretUri. It's for scenario that user provides a secret stored in user's keyvault /// and source is Web App, Spring Cloud or Container App. internal partial interface IKeyVaultSecretUriSecretInfoInternal : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBaseInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBaseInternal { /// URI to the keyvault secret string Value { get; set; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/KeyVaultSecretUriSecretInfo.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/KeyVaultSecretUriSecretInfo.json.cs similarity index 93% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/KeyVaultSecretUriSecretInfo.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/KeyVaultSecretUriSecretInfo.json.cs index b0c91057fc92..a48bad4e8595 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/KeyVaultSecretUriSecretInfo.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/KeyVaultSecretUriSecretInfo.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -57,13 +57,13 @@ public partial class KeyVaultSecretUriSecretInfo partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretUriSecretInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretUriSecretInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretUriSecretInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretUriSecretInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretUriSecretInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretUriSecretInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new KeyVaultSecretUriSecretInfo(json) : null; } @@ -80,8 +80,8 @@ internal KeyVaultSecretUriSecretInfo(Microsoft.Azure.PowerShell.Cmdlets.ServiceL { return; } - __secretInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretInfoBase(json); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + __secretInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretInfoBase(json); + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)_value;} AfterFromJson(json); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerPatch.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerPatch.PowerShell.cs new file mode 100644 index 000000000000..8bdfb4661f37 --- /dev/null +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerPatch.PowerShell.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + + /// A Linker to be updated. + [System.ComponentModel.TypeConverter(typeof(LinkerPatchTypeConverter))] + public partial class LinkerPatch + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatch DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LinkerPatch(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LinkerPatch(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LinkerPatch(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.ServiceLinker.Models.ILinkerPatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SecretStore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).SecretStore = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore) content.GetValueForProperty("SecretStore",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).SecretStore, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretStoreTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ConfigurationInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo) content.GetValueForProperty("ConfigurationInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ConfigurationInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ClientType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ClientType = (string) content.GetValueForProperty("ClientType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ClientType, global::System.Convert.ToString); + } + if (content.Contains("VNetSolution")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).VNetSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution) content.GetValueForProperty("VNetSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).VNetSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.VNetSolutionTypeConverter.ConvertFrom); + } + if (content.Contains("PublicNetworkSolution")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).PublicNetworkSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution) content.GetValueForProperty("PublicNetworkSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).PublicNetworkSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.PublicNetworkSolutionTypeConverter.ConvertFrom); + } + if (content.Contains("TargetService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).TargetService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase) content.GetValueForProperty("TargetService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).TargetService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.TargetServiceBaseTypeConverter.ConvertFrom); + } + if (content.Contains("AuthInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).AuthInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase) content.GetValueForProperty("AuthInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).AuthInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AuthInfoBaseTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("VNetSolutionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).VNetSolutionType = (string) content.GetValueForProperty("VNetSolutionType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).VNetSolutionType, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkSolutionFirewallRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).PublicNetworkSolutionFirewallRule = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules) content.GetValueForProperty("PublicNetworkSolutionFirewallRule",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).PublicNetworkSolutionFirewallRule, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.FirewallRulesTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationInfoCustomizedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ConfigurationInfoCustomizedKey = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys) content.GetValueForProperty("ConfigurationInfoCustomizedKey",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ConfigurationInfoCustomizedKey, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoCustomizedKeysTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationInfoAdditionalConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ConfigurationInfoAdditionalConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations) content.GetValueForProperty("ConfigurationInfoAdditionalConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ConfigurationInfoAdditionalConfiguration, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoAdditionalConfigurationsTypeConverter.ConvertFrom); + } + if (content.Contains("VNetSolutionDeleteOrUpdateBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).VNetSolutionDeleteOrUpdateBehavior = (string) content.GetValueForProperty("VNetSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).VNetSolutionDeleteOrUpdateBehavior, global::System.Convert.ToString); + } + if (content.Contains("SecretStoreKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).SecretStoreKeyVaultId = (string) content.GetValueForProperty("SecretStoreKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).SecretStoreKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("SecretStoreKeyVaultSecretName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).SecretStoreKeyVaultSecretName = (string) content.GetValueForProperty("SecretStoreKeyVaultSecretName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).SecretStoreKeyVaultSecretName, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkSolutionDeleteOrUpdateBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior = (string) content.GetValueForProperty("PublicNetworkSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkSolutionAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).PublicNetworkSolutionAction = (string) content.GetValueForProperty("PublicNetworkSolutionAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).PublicNetworkSolutionAction, global::System.Convert.ToString); + } + if (content.Contains("FirewallRuleIPRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).FirewallRuleIPRange = (System.Collections.Generic.List) content.GetValueForProperty("FirewallRuleIPRange",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).FirewallRuleIPRange, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ConfigurationInfoDeleteOrUpdateBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ConfigurationInfoDeleteOrUpdateBehavior = (string) content.GetValueForProperty("ConfigurationInfoDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ConfigurationInfoDeleteOrUpdateBehavior, global::System.Convert.ToString); + } + if (content.Contains("ConfigurationInfoAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ConfigurationInfoAction = (string) content.GetValueForProperty("ConfigurationInfoAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ConfigurationInfoAction, global::System.Convert.ToString); + } + if (content.Contains("FirewallRuleAzureService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).FirewallRuleAzureService = (string) content.GetValueForProperty("FirewallRuleAzureService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).FirewallRuleAzureService, global::System.Convert.ToString); + } + if (content.Contains("FirewallRuleCallerClientIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).FirewallRuleCallerClientIP = (string) content.GetValueForProperty("FirewallRuleCallerClientIP",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).FirewallRuleCallerClientIP, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal LinkerPatch(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.ServiceLinker.Models.ILinkerPatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SecretStore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).SecretStore = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore) content.GetValueForProperty("SecretStore",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).SecretStore, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretStoreTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ConfigurationInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo) content.GetValueForProperty("ConfigurationInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ConfigurationInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ClientType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ClientType = (string) content.GetValueForProperty("ClientType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ClientType, global::System.Convert.ToString); + } + if (content.Contains("VNetSolution")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).VNetSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution) content.GetValueForProperty("VNetSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).VNetSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.VNetSolutionTypeConverter.ConvertFrom); + } + if (content.Contains("PublicNetworkSolution")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).PublicNetworkSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution) content.GetValueForProperty("PublicNetworkSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).PublicNetworkSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.PublicNetworkSolutionTypeConverter.ConvertFrom); + } + if (content.Contains("TargetService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).TargetService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase) content.GetValueForProperty("TargetService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).TargetService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.TargetServiceBaseTypeConverter.ConvertFrom); + } + if (content.Contains("AuthInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).AuthInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase) content.GetValueForProperty("AuthInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).AuthInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AuthInfoBaseTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("VNetSolutionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).VNetSolutionType = (string) content.GetValueForProperty("VNetSolutionType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).VNetSolutionType, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkSolutionFirewallRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).PublicNetworkSolutionFirewallRule = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules) content.GetValueForProperty("PublicNetworkSolutionFirewallRule",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).PublicNetworkSolutionFirewallRule, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.FirewallRulesTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationInfoCustomizedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ConfigurationInfoCustomizedKey = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys) content.GetValueForProperty("ConfigurationInfoCustomizedKey",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ConfigurationInfoCustomizedKey, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoCustomizedKeysTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationInfoAdditionalConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ConfigurationInfoAdditionalConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations) content.GetValueForProperty("ConfigurationInfoAdditionalConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ConfigurationInfoAdditionalConfiguration, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoAdditionalConfigurationsTypeConverter.ConvertFrom); + } + if (content.Contains("VNetSolutionDeleteOrUpdateBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).VNetSolutionDeleteOrUpdateBehavior = (string) content.GetValueForProperty("VNetSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).VNetSolutionDeleteOrUpdateBehavior, global::System.Convert.ToString); + } + if (content.Contains("SecretStoreKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).SecretStoreKeyVaultId = (string) content.GetValueForProperty("SecretStoreKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).SecretStoreKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("SecretStoreKeyVaultSecretName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).SecretStoreKeyVaultSecretName = (string) content.GetValueForProperty("SecretStoreKeyVaultSecretName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).SecretStoreKeyVaultSecretName, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkSolutionDeleteOrUpdateBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior = (string) content.GetValueForProperty("PublicNetworkSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkSolutionAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).PublicNetworkSolutionAction = (string) content.GetValueForProperty("PublicNetworkSolutionAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).PublicNetworkSolutionAction, global::System.Convert.ToString); + } + if (content.Contains("FirewallRuleIPRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).FirewallRuleIPRange = (System.Collections.Generic.List) content.GetValueForProperty("FirewallRuleIPRange",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).FirewallRuleIPRange, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ConfigurationInfoDeleteOrUpdateBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ConfigurationInfoDeleteOrUpdateBehavior = (string) content.GetValueForProperty("ConfigurationInfoDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ConfigurationInfoDeleteOrUpdateBehavior, global::System.Convert.ToString); + } + if (content.Contains("ConfigurationInfoAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ConfigurationInfoAction = (string) content.GetValueForProperty("ConfigurationInfoAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).ConfigurationInfoAction, global::System.Convert.ToString); + } + if (content.Contains("FirewallRuleAzureService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).FirewallRuleAzureService = (string) content.GetValueForProperty("FirewallRuleAzureService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).FirewallRuleAzureService, global::System.Convert.ToString); + } + if (content.Contains("FirewallRuleCallerClientIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).FirewallRuleCallerClientIP = (string) content.GetValueForProperty("FirewallRuleCallerClientIP",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal)this).FirewallRuleCallerClientIP, 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.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// A Linker to be updated. + [System.ComponentModel.TypeConverter(typeof(LinkerPatchTypeConverter))] + public partial interface ILinkerPatch + + { + + } +} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerPatch.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerPatch.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerPatch.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerPatch.TypeConverter.cs index 69409d92e783..0f6ff80220a7 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerPatch.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerPatch.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatch ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatch ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatch).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatch).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerPatch.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerPatch.cs similarity index 56% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerPatch.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerPatch.cs index 17ea11ab5aec..2e8b5522774e 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerPatch.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerPatch.cs @@ -3,139 +3,139 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// A Linker to be updated. public partial class LinkerPatch : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatch, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatch, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal { /// The authentication type. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase AuthInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).AuthInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).AuthInfo = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase AuthInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).AuthInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).AuthInfo = value ?? null /* model class */; } /// The application client type [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType? ClientType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ClientType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ClientType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType)""); } + public string ClientType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ClientType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ClientType = value ?? null; } /// /// Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied /// to the source application. Default is enable. If optOut, no configuration change will be made on source. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? ConfigurationInfoAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ConfigurationInfoAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ConfigurationInfoAction = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType)""); } + public string ConfigurationInfoAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ConfigurationInfoAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ConfigurationInfoAction = value ?? null; } /// /// A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this /// property is to full fill more customized configurations /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ConfigurationInfoAdditionalConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ConfigurationInfoAdditionalConfiguration = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ConfigurationInfoAdditionalConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ConfigurationInfoAdditionalConfiguration = value ?? null /* model class */; } /// /// Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be /// used for generate configurations /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ConfigurationInfoCustomizedKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ConfigurationInfoCustomizedKey = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ConfigurationInfoCustomizedKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ConfigurationInfoCustomizedKey = value ?? null /* model class */; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? ConfigurationInfoDeleteOrUpdateBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ConfigurationInfoDeleteOrUpdateBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ConfigurationInfoDeleteOrUpdateBehavior = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior)""); } + public string ConfigurationInfoDeleteOrUpdateBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ConfigurationInfoDeleteOrUpdateBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ConfigurationInfoDeleteOrUpdateBehavior = value ?? null; } /// Allow Azure services to access the target service if true. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? FirewallRuleAzureService { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).FirewallRuleAzureService; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).FirewallRuleAzureService = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType)""); } + public string FirewallRuleAzureService { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).FirewallRuleAzureService; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).FirewallRuleAzureService = value ?? null; } /// /// Allow caller client IP to access the target service if true. the property is used when connecting local application to /// target service. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? FirewallRuleCallerClientIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).FirewallRuleCallerClientIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).FirewallRuleCallerClientIP = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType)""); } + public string FirewallRuleCallerClientIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).FirewallRuleCallerClientIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).FirewallRuleCallerClientIP = value ?? null; } /// /// This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client /// IPs for a given database account. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string[] FirewallRuleIPRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).FirewallRuleIPRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).FirewallRuleIPRange = value ?? null /* arrayOf */; } + public System.Collections.Generic.List FirewallRuleIPRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).FirewallRuleIPRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).FirewallRuleIPRange = value ?? null /* arrayOf */; } /// Internal Acessors for ConfigurationInfo - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal.ConfigurationInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ConfigurationInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ConfigurationInfo = value; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal.ConfigurationInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ConfigurationInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ConfigurationInfo = value ?? null /* model class */; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerProperties Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerProperties Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ProvisioningState = value ?? null; } /// Internal Acessors for PublicNetworkSolution - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolution Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal.PublicNetworkSolution { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).PublicNetworkSolution; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).PublicNetworkSolution = value; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal.PublicNetworkSolution { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).PublicNetworkSolution; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).PublicNetworkSolution = value ?? null /* model class */; } /// Internal Acessors for PublicNetworkSolutionFirewallRule - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal.PublicNetworkSolutionFirewallRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).PublicNetworkSolutionFirewallRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).PublicNetworkSolutionFirewallRule = value; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal.PublicNetworkSolutionFirewallRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).PublicNetworkSolutionFirewallRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).PublicNetworkSolutionFirewallRule = value ?? null /* model class */; } /// Internal Acessors for SecretStore - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStore Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal.SecretStore { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).SecretStore; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).SecretStore = value; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal.SecretStore { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).SecretStore; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).SecretStore = value ?? null /* model class */; } /// Internal Acessors for VNetSolution - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolution Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatchInternal.VNetSolution { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).VNetSolution; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).VNetSolution = value; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatchInternal.VNetSolution { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).VNetSolution; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).VNetSolution = value ?? null /* model class */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerProperties _property; /// Linker properties [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerProperties()); set => this._property = value; } /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ProvisioningState; } /// /// Optional. Indicates public network solution. If enable, enable public network access of target service with best try. /// Default is enable. If optOut, opt out public network access configuration. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? PublicNetworkSolutionAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).PublicNetworkSolutionAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).PublicNetworkSolutionAction = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType)""); } + public string PublicNetworkSolutionAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).PublicNetworkSolutionAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).PublicNetworkSolutionAction = value ?? null; } /// /// Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? PublicNetworkSolutionDeleteOrUpdateBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).PublicNetworkSolutionDeleteOrUpdateBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).PublicNetworkSolutionDeleteOrUpdateBehavior = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior)""); } + public string PublicNetworkSolutionDeleteOrUpdateBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).PublicNetworkSolutionDeleteOrUpdateBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).PublicNetworkSolutionDeleteOrUpdateBehavior = value ?? null; } /// connection scope in source service. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).Scope = value ?? null; } + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).Scope = value ?? null; } /// The key vault id to store secret [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string SecretStoreKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).SecretStoreKeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).SecretStoreKeyVaultId = value ?? null; } + public string SecretStoreKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).SecretStoreKeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).SecretStoreKeyVaultId = value ?? null; } /// The key vault secret name to store secret, only valid when storing one secret [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string SecretStoreKeyVaultSecretName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).SecretStoreKeyVaultSecretName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).SecretStoreKeyVaultSecretName = value ?? null; } + public string SecretStoreKeyVaultSecretName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).SecretStoreKeyVaultSecretName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).SecretStoreKeyVaultSecretName = value ?? null; } /// The target service properties [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase TargetService { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).TargetService; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).TargetService = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase TargetService { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).TargetService; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).TargetService = value ?? null /* model class */; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? VNetSolutionDeleteOrUpdateBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).VNetSolutionDeleteOrUpdateBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).VNetSolutionDeleteOrUpdateBehavior = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior)""); } + public string VNetSolutionDeleteOrUpdateBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).VNetSolutionDeleteOrUpdateBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).VNetSolutionDeleteOrUpdateBehavior = value ?? null; } /// Type of VNet solution. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType? VNetSolutionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).VNetSolutionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).VNetSolutionType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType)""); } + public string VNetSolutionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).VNetSolutionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).VNetSolutionType = value ?? null; } /// Creates an new instance. public LinkerPatch() @@ -151,18 +151,25 @@ public partial interface ILinkerPatch : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The authentication type.", SerializedName = @"authInfo", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase AuthInfo { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase) })] + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase AuthInfo { get; set; } /// The application client type [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The application client type", SerializedName = @"clientType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType? ClientType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] + string ClientType { get; set; } /// /// Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied /// to the source application. Default is enable. If optOut, no configuration change will be made on source. @@ -170,10 +177,14 @@ public partial interface ILinkerPatch : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied to the source application. Default is enable. If optOut, no configuration change will be made on source.", SerializedName = @"action", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? ConfigurationInfoAction { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + string ConfigurationInfoAction { get; set; } /// /// A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this /// property is to full fill more customized configurations @@ -181,10 +192,13 @@ public partial interface ILinkerPatch : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this property is to full fill more customized configurations", SerializedName = @"additionalConfigurations", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations) })] + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get; set; } /// /// Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be /// used for generate configurations @@ -192,28 +206,39 @@ public partial interface ILinkerPatch : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be used for generate configurations", SerializedName = @"customizedKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys) })] + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get; set; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether to clean up previous operation when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? ConfigurationInfoDeleteOrUpdateBehavior { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string ConfigurationInfoDeleteOrUpdateBehavior { get; set; } /// Allow Azure services to access the target service if true. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Allow Azure services to access the target service if true.", SerializedName = @"azureServices", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? FirewallRuleAzureService { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + string FirewallRuleAzureService { get; set; } /// /// Allow caller client IP to access the target service if true. the property is used when connecting local application to /// target service. @@ -221,10 +246,14 @@ public partial interface ILinkerPatch : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Allow caller client IP to access the target service if true. the property is used when connecting local application to target service.", SerializedName = @"callerClientIP", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? FirewallRuleCallerClientIP { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + string FirewallRuleCallerClientIP { get; set; } /// /// This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client /// IPs for a given database account. @@ -232,14 +261,20 @@ public partial interface ILinkerPatch : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account.", SerializedName = @"ipRanges", PossibleTypes = new [] { typeof(string) })] - string[] FirewallRuleIPRange { get; set; } + System.Collections.Generic.List FirewallRuleIPRange { get; set; } /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state. ", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] @@ -251,24 +286,35 @@ public partial interface ILinkerPatch : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Optional. Indicates public network solution. If enable, enable public network access of target service with best try. Default is enable. If optOut, opt out public network access configuration.", SerializedName = @"action", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? PublicNetworkSolutionAction { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + string PublicNetworkSolutionAction { get; set; } /// /// Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? PublicNetworkSolutionDeleteOrUpdateBehavior { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string PublicNetworkSolutionDeleteOrUpdateBehavior { get; set; } /// connection scope in source service. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"connection scope in source service.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -277,6 +323,9 @@ public partial interface ILinkerPatch : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The key vault id to store secret", SerializedName = @"keyVaultId", PossibleTypes = new [] { typeof(string) })] @@ -285,6 +334,9 @@ public partial interface ILinkerPatch : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The key vault secret name to store secret, only valid when storing one secret", SerializedName = @"keyVaultSecretName", PossibleTypes = new [] { typeof(string) })] @@ -293,28 +345,39 @@ public partial interface ILinkerPatch : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The target service properties", SerializedName = @"targetService", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase TargetService { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase) })] + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase TargetService { get; set; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether to clean up previous operation when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? VNetSolutionDeleteOrUpdateBehavior { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string VNetSolutionDeleteOrUpdateBehavior { get; set; } /// Type of VNet solution. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of VNet solution.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType? VNetSolutionType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] + string VNetSolutionType { get; set; } } /// A Linker to be updated. @@ -322,81 +385,90 @@ internal partial interface ILinkerPatchInternal { /// The authentication type. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase AuthInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase AuthInfo { get; set; } /// The application client type - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType? ClientType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] + string ClientType { get; set; } /// /// The connection information consumed by applications, including secrets, connection strings. /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo ConfigurationInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo ConfigurationInfo { get; set; } /// /// Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied /// to the source application. Default is enable. If optOut, no configuration change will be made on source. /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? ConfigurationInfoAction { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + string ConfigurationInfoAction { get; set; } /// /// A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this /// property is to full fill more customized configurations /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get; set; } /// /// Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be /// used for generate configurations /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get; set; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? ConfigurationInfoDeleteOrUpdateBehavior { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string ConfigurationInfoDeleteOrUpdateBehavior { get; set; } /// Allow Azure services to access the target service if true. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? FirewallRuleAzureService { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + string FirewallRuleAzureService { get; set; } /// /// Allow caller client IP to access the target service if true. the property is used when connecting local application to /// target service. /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? FirewallRuleCallerClientIP { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + string FirewallRuleCallerClientIP { get; set; } /// /// This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client /// IPs for a given database account. /// - string[] FirewallRuleIPRange { get; set; } + System.Collections.Generic.List FirewallRuleIPRange { get; set; } /// Linker properties - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerProperties Property { get; set; } /// The provisioning state. string ProvisioningState { get; set; } /// The network solution. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolution PublicNetworkSolution { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution PublicNetworkSolution { get; set; } /// /// Optional. Indicates public network solution. If enable, enable public network access of target service with best try. /// Default is enable. If optOut, opt out public network access configuration. /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? PublicNetworkSolutionAction { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + string PublicNetworkSolutionAction { get; set; } /// /// Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? PublicNetworkSolutionDeleteOrUpdateBehavior { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string PublicNetworkSolutionDeleteOrUpdateBehavior { get; set; } /// /// Describe firewall rules of target service to make sure source application could connect to the target. /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules PublicNetworkSolutionFirewallRule { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules PublicNetworkSolutionFirewallRule { get; set; } /// connection scope in source service. string Scope { get; set; } /// An option to store secret value in secure place - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStore SecretStore { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore SecretStore { get; set; } /// The key vault id to store secret string SecretStoreKeyVaultId { get; set; } /// The key vault secret name to store secret, only valid when storing one secret string SecretStoreKeyVaultSecretName { get; set; } /// The target service properties - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase TargetService { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase TargetService { get; set; } /// The VNet solution. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolution VNetSolution { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution VNetSolution { get; set; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? VNetSolutionDeleteOrUpdateBehavior { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string VNetSolutionDeleteOrUpdateBehavior { get; set; } /// Type of VNet solution. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType? VNetSolutionType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] + string VNetSolutionType { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerPatch.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerPatch.json.cs similarity index 94% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerPatch.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerPatch.json.cs index 0f6450a940d5..e4a6b3dfae4f 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerPatch.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerPatch.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class LinkerPatch partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatch. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatch. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatch. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatch. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new LinkerPatch(json) : null; } @@ -77,7 +77,7 @@ internal LinkerPatch(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Js { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerProperties.FromJson(__jsonProperties) : Property;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerProperties.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerProperties.PowerShell.cs new file mode 100644 index 000000000000..171e00569204 --- /dev/null +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerProperties.PowerShell.cs @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + + /// The properties of the Linker. + [System.ComponentModel.TypeConverter(typeof(LinkerPropertiesTypeConverter))] + public partial class LinkerProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LinkerProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LinkerProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LinkerProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("VNetSolution")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).VNetSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution) content.GetValueForProperty("VNetSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).VNetSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.VNetSolutionTypeConverter.ConvertFrom); + } + if (content.Contains("SecretStore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).SecretStore = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore) content.GetValueForProperty("SecretStore",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).SecretStore, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretStoreTypeConverter.ConvertFrom); + } + if (content.Contains("PublicNetworkSolution")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution) content.GetValueForProperty("PublicNetworkSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.PublicNetworkSolutionTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo) content.GetValueForProperty("ConfigurationInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).TargetService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase) content.GetValueForProperty("TargetService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).TargetService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.TargetServiceBaseTypeConverter.ConvertFrom); + } + if (content.Contains("AuthInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).AuthInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase) content.GetValueForProperty("AuthInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).AuthInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AuthInfoBaseTypeConverter.ConvertFrom); + } + if (content.Contains("ClientType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ClientType = (string) content.GetValueForProperty("ClientType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ClientType, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("VNetSolutionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).VNetSolutionType = (string) content.GetValueForProperty("VNetSolutionType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).VNetSolutionType, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkSolutionFirewallRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolutionFirewallRule = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules) content.GetValueForProperty("PublicNetworkSolutionFirewallRule",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolutionFirewallRule, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.FirewallRulesTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationInfoCustomizedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoCustomizedKey = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys) content.GetValueForProperty("ConfigurationInfoCustomizedKey",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoCustomizedKey, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoCustomizedKeysTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationInfoAdditionalConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoAdditionalConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations) content.GetValueForProperty("ConfigurationInfoAdditionalConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoAdditionalConfiguration, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoAdditionalConfigurationsTypeConverter.ConvertFrom); + } + if (content.Contains("VNetSolutionDeleteOrUpdateBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).VNetSolutionDeleteOrUpdateBehavior = (string) content.GetValueForProperty("VNetSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).VNetSolutionDeleteOrUpdateBehavior, global::System.Convert.ToString); + } + if (content.Contains("SecretStoreKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).SecretStoreKeyVaultId = (string) content.GetValueForProperty("SecretStoreKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).SecretStoreKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("SecretStoreKeyVaultSecretName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).SecretStoreKeyVaultSecretName = (string) content.GetValueForProperty("SecretStoreKeyVaultSecretName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).SecretStoreKeyVaultSecretName, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkSolutionDeleteOrUpdateBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior = (string) content.GetValueForProperty("PublicNetworkSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkSolutionAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolutionAction = (string) content.GetValueForProperty("PublicNetworkSolutionAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolutionAction, global::System.Convert.ToString); + } + if (content.Contains("FirewallRuleIPRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).FirewallRuleIPRange = (System.Collections.Generic.List) content.GetValueForProperty("FirewallRuleIPRange",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).FirewallRuleIPRange, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ConfigurationInfoDeleteOrUpdateBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoDeleteOrUpdateBehavior = (string) content.GetValueForProperty("ConfigurationInfoDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoDeleteOrUpdateBehavior, global::System.Convert.ToString); + } + if (content.Contains("ConfigurationInfoAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoAction = (string) content.GetValueForProperty("ConfigurationInfoAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoAction, global::System.Convert.ToString); + } + if (content.Contains("FirewallRuleAzureService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).FirewallRuleAzureService = (string) content.GetValueForProperty("FirewallRuleAzureService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).FirewallRuleAzureService, global::System.Convert.ToString); + } + if (content.Contains("FirewallRuleCallerClientIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).FirewallRuleCallerClientIP = (string) content.GetValueForProperty("FirewallRuleCallerClientIP",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).FirewallRuleCallerClientIP, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal LinkerProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("VNetSolution")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).VNetSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution) content.GetValueForProperty("VNetSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).VNetSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.VNetSolutionTypeConverter.ConvertFrom); + } + if (content.Contains("SecretStore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).SecretStore = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore) content.GetValueForProperty("SecretStore",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).SecretStore, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretStoreTypeConverter.ConvertFrom); + } + if (content.Contains("PublicNetworkSolution")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution) content.GetValueForProperty("PublicNetworkSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.PublicNetworkSolutionTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo) content.GetValueForProperty("ConfigurationInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TargetService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).TargetService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase) content.GetValueForProperty("TargetService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).TargetService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.TargetServiceBaseTypeConverter.ConvertFrom); + } + if (content.Contains("AuthInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).AuthInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase) content.GetValueForProperty("AuthInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).AuthInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AuthInfoBaseTypeConverter.ConvertFrom); + } + if (content.Contains("ClientType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ClientType = (string) content.GetValueForProperty("ClientType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ClientType, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("VNetSolutionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).VNetSolutionType = (string) content.GetValueForProperty("VNetSolutionType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).VNetSolutionType, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkSolutionFirewallRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolutionFirewallRule = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules) content.GetValueForProperty("PublicNetworkSolutionFirewallRule",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolutionFirewallRule, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.FirewallRulesTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationInfoCustomizedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoCustomizedKey = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys) content.GetValueForProperty("ConfigurationInfoCustomizedKey",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoCustomizedKey, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoCustomizedKeysTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationInfoAdditionalConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoAdditionalConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations) content.GetValueForProperty("ConfigurationInfoAdditionalConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoAdditionalConfiguration, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoAdditionalConfigurationsTypeConverter.ConvertFrom); + } + if (content.Contains("VNetSolutionDeleteOrUpdateBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).VNetSolutionDeleteOrUpdateBehavior = (string) content.GetValueForProperty("VNetSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).VNetSolutionDeleteOrUpdateBehavior, global::System.Convert.ToString); + } + if (content.Contains("SecretStoreKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).SecretStoreKeyVaultId = (string) content.GetValueForProperty("SecretStoreKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).SecretStoreKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("SecretStoreKeyVaultSecretName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).SecretStoreKeyVaultSecretName = (string) content.GetValueForProperty("SecretStoreKeyVaultSecretName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).SecretStoreKeyVaultSecretName, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkSolutionDeleteOrUpdateBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior = (string) content.GetValueForProperty("PublicNetworkSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkSolutionAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolutionAction = (string) content.GetValueForProperty("PublicNetworkSolutionAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).PublicNetworkSolutionAction, global::System.Convert.ToString); + } + if (content.Contains("FirewallRuleIPRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).FirewallRuleIPRange = (System.Collections.Generic.List) content.GetValueForProperty("FirewallRuleIPRange",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).FirewallRuleIPRange, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ConfigurationInfoDeleteOrUpdateBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoDeleteOrUpdateBehavior = (string) content.GetValueForProperty("ConfigurationInfoDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoDeleteOrUpdateBehavior, global::System.Convert.ToString); + } + if (content.Contains("ConfigurationInfoAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoAction = (string) content.GetValueForProperty("ConfigurationInfoAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).ConfigurationInfoAction, global::System.Convert.ToString); + } + if (content.Contains("FirewallRuleAzureService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).FirewallRuleAzureService = (string) content.GetValueForProperty("FirewallRuleAzureService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).FirewallRuleAzureService, global::System.Convert.ToString); + } + if (content.Contains("FirewallRuleCallerClientIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).FirewallRuleCallerClientIP = (string) content.GetValueForProperty("FirewallRuleCallerClientIP",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)this).FirewallRuleCallerClientIP, 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.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The properties of the Linker. + [System.ComponentModel.TypeConverter(typeof(LinkerPropertiesTypeConverter))] + public partial interface ILinkerProperties + + { + + } +} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerProperties.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerProperties.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerProperties.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerProperties.TypeConverter.cs index d1d193ff8846..8c589819e51f 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerProperties.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerProperties.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerProperties.cs similarity index 59% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerProperties.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerProperties.cs index 5841bf26b7b1..57407d69491a 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerProperties.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerProperties.cs @@ -3,101 +3,101 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The properties of the Linker. public partial class LinkerProperties : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerProperties, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerProperties, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase _authInfo; + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase _authInfo; /// The authentication type. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase AuthInfo { get => (this._authInfo = this._authInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AuthInfoBase()); set => this._authInfo = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase AuthInfo { get => (this._authInfo = this._authInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AuthInfoBase()); set => this._authInfo = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType? _clientType; + private string _clientType; /// The application client type [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType? ClientType { get => this._clientType; set => this._clientType = value; } + public string ClientType { get => this._clientType; set => this._clientType = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo _configurationInfo; + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo _configurationInfo; /// /// The connection information consumed by applications, including secrets, connection strings. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo ConfigurationInfo { get => (this._configurationInfo = this._configurationInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfo()); set => this._configurationInfo = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo ConfigurationInfo { get => (this._configurationInfo = this._configurationInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfo()); set => this._configurationInfo = value; } /// /// Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied /// to the source application. Default is enable. If optOut, no configuration change will be made on source. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? ConfigurationInfoAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoInternal)ConfigurationInfo).Action; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoInternal)ConfigurationInfo).Action = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType)""); } + public string ConfigurationInfoAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoInternal)ConfigurationInfo).Action; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoInternal)ConfigurationInfo).Action = value ?? null; } /// /// A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this /// property is to full fill more customized configurations /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoInternal)ConfigurationInfo).AdditionalConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoInternal)ConfigurationInfo).AdditionalConfiguration = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoInternal)ConfigurationInfo).AdditionalConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoInternal)ConfigurationInfo).AdditionalConfiguration = value ?? null /* model class */; } /// /// Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be /// used for generate configurations /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoInternal)ConfigurationInfo).CustomizedKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoInternal)ConfigurationInfo).CustomizedKey = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoInternal)ConfigurationInfo).CustomizedKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoInternal)ConfigurationInfo).CustomizedKey = value ?? null /* model class */; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? ConfigurationInfoDeleteOrUpdateBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoInternal)ConfigurationInfo).DeleteOrUpdateBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoInternal)ConfigurationInfo).DeleteOrUpdateBehavior = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior)""); } + public string ConfigurationInfoDeleteOrUpdateBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoInternal)ConfigurationInfo).DeleteOrUpdateBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoInternal)ConfigurationInfo).DeleteOrUpdateBehavior = value ?? null; } /// Allow Azure services to access the target service if true. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? FirewallRuleAzureService { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)PublicNetworkSolution).FirewallRuleAzureService; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)PublicNetworkSolution).FirewallRuleAzureService = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType)""); } + public string FirewallRuleAzureService { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)PublicNetworkSolution).FirewallRuleAzureService; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)PublicNetworkSolution).FirewallRuleAzureService = value ?? null; } /// /// Allow caller client IP to access the target service if true. the property is used when connecting local application to /// target service. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? FirewallRuleCallerClientIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)PublicNetworkSolution).FirewallRuleCallerClientIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)PublicNetworkSolution).FirewallRuleCallerClientIP = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType)""); } + public string FirewallRuleCallerClientIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)PublicNetworkSolution).FirewallRuleCallerClientIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)PublicNetworkSolution).FirewallRuleCallerClientIP = value ?? null; } /// /// This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client /// IPs for a given database account. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string[] FirewallRuleIPRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)PublicNetworkSolution).FirewallRuleIPRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)PublicNetworkSolution).FirewallRuleIPRange = value ?? null /* arrayOf */; } + public System.Collections.Generic.List FirewallRuleIPRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)PublicNetworkSolution).FirewallRuleIPRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)PublicNetworkSolution).FirewallRuleIPRange = value ?? null /* arrayOf */; } /// Internal Acessors for ConfigurationInfo - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal.ConfigurationInfo { get => (this._configurationInfo = this._configurationInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfo()); set { {_configurationInfo = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal.ConfigurationInfo { get => (this._configurationInfo = this._configurationInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfo()); set { {_configurationInfo = value;} } } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Internal Acessors for PublicNetworkSolution - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolution Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal.PublicNetworkSolution { get => (this._publicNetworkSolution = this._publicNetworkSolution ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.PublicNetworkSolution()); set { {_publicNetworkSolution = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal.PublicNetworkSolution { get => (this._publicNetworkSolution = this._publicNetworkSolution ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.PublicNetworkSolution()); set { {_publicNetworkSolution = value;} } } /// Internal Acessors for PublicNetworkSolutionFirewallRule - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal.PublicNetworkSolutionFirewallRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)PublicNetworkSolution).FirewallRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)PublicNetworkSolution).FirewallRule = value; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal.PublicNetworkSolutionFirewallRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)PublicNetworkSolution).FirewallRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)PublicNetworkSolution).FirewallRule = value ?? null /* model class */; } /// Internal Acessors for SecretStore - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStore Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal.SecretStore { get => (this._secretStore = this._secretStore ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretStore()); set { {_secretStore = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal.SecretStore { get => (this._secretStore = this._secretStore ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretStore()); set { {_secretStore = value;} } } /// Internal Acessors for VNetSolution - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolution Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal.VNetSolution { get => (this._vNetSolution = this._vNetSolution ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.VNetSolution()); set { {_vNetSolution = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal.VNetSolution { get => (this._vNetSolution = this._vNetSolution ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.VNetSolution()); set { {_vNetSolution = value;} } } /// Backing field for property. private string _provisioningState; @@ -107,24 +107,24 @@ public partial class LinkerProperties : public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolution _publicNetworkSolution; + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution _publicNetworkSolution; /// The network solution. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolution PublicNetworkSolution { get => (this._publicNetworkSolution = this._publicNetworkSolution ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.PublicNetworkSolution()); set => this._publicNetworkSolution = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution PublicNetworkSolution { get => (this._publicNetworkSolution = this._publicNetworkSolution ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.PublicNetworkSolution()); set => this._publicNetworkSolution = value; } /// /// Optional. Indicates public network solution. If enable, enable public network access of target service with best try. /// Default is enable. If optOut, opt out public network access configuration. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? PublicNetworkSolutionAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)PublicNetworkSolution).Action; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)PublicNetworkSolution).Action = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType)""); } + public string PublicNetworkSolutionAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)PublicNetworkSolution).Action; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)PublicNetworkSolution).Action = value ?? null; } /// /// Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? PublicNetworkSolutionDeleteOrUpdateBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)PublicNetworkSolution).DeleteOrUpdateBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)PublicNetworkSolution).DeleteOrUpdateBehavior = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior)""); } + public string PublicNetworkSolutionDeleteOrUpdateBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)PublicNetworkSolution).DeleteOrUpdateBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)PublicNetworkSolution).DeleteOrUpdateBehavior = value ?? null; } /// Backing field for property. private string _scope; @@ -134,43 +134,43 @@ public partial class LinkerProperties : public string Scope { get => this._scope; set => this._scope = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStore _secretStore; + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore _secretStore; /// An option to store secret value in secure place [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStore SecretStore { get => (this._secretStore = this._secretStore ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretStore()); set => this._secretStore = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore SecretStore { get => (this._secretStore = this._secretStore ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretStore()); set => this._secretStore = value; } /// The key vault id to store secret [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string SecretStoreKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStoreInternal)SecretStore).KeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStoreInternal)SecretStore).KeyVaultId = value ?? null; } + public string SecretStoreKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStoreInternal)SecretStore).KeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStoreInternal)SecretStore).KeyVaultId = value ?? null; } /// The key vault secret name to store secret, only valid when storing one secret [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string SecretStoreKeyVaultSecretName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStoreInternal)SecretStore).KeyVaultSecretName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStoreInternal)SecretStore).KeyVaultSecretName = value ?? null; } + public string SecretStoreKeyVaultSecretName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStoreInternal)SecretStore).KeyVaultSecretName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStoreInternal)SecretStore).KeyVaultSecretName = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase _targetService; + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase _targetService; /// The target service properties [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase TargetService { get => (this._targetService = this._targetService ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.TargetServiceBase()); set => this._targetService = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase TargetService { get => (this._targetService = this._targetService ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.TargetServiceBase()); set => this._targetService = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolution _vNetSolution; + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution _vNetSolution; /// The VNet solution. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolution VNetSolution { get => (this._vNetSolution = this._vNetSolution ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.VNetSolution()); set => this._vNetSolution = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution VNetSolution { get => (this._vNetSolution = this._vNetSolution ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.VNetSolution()); set => this._vNetSolution = value; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? VNetSolutionDeleteOrUpdateBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolutionInternal)VNetSolution).DeleteOrUpdateBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolutionInternal)VNetSolution).DeleteOrUpdateBehavior = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior)""); } + public string VNetSolutionDeleteOrUpdateBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolutionInternal)VNetSolution).DeleteOrUpdateBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolutionInternal)VNetSolution).DeleteOrUpdateBehavior = value ?? null; } /// Type of VNet solution. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType? VNetSolutionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolutionInternal)VNetSolution).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolutionInternal)VNetSolution).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType)""); } + public string VNetSolutionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolutionInternal)VNetSolution).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolutionInternal)VNetSolution).Type = value ?? null; } /// Creates an new instance. public LinkerProperties() @@ -186,18 +186,25 @@ public partial interface ILinkerProperties : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The authentication type.", SerializedName = @"authInfo", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase AuthInfo { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase) })] + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase AuthInfo { get; set; } /// The application client type [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The application client type", SerializedName = @"clientType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType? ClientType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] + string ClientType { get; set; } /// /// Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied /// to the source application. Default is enable. If optOut, no configuration change will be made on source. @@ -205,10 +212,14 @@ public partial interface ILinkerProperties : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied to the source application. Default is enable. If optOut, no configuration change will be made on source.", SerializedName = @"action", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? ConfigurationInfoAction { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + string ConfigurationInfoAction { get; set; } /// /// A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this /// property is to full fill more customized configurations @@ -216,10 +227,13 @@ public partial interface ILinkerProperties : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this property is to full fill more customized configurations", SerializedName = @"additionalConfigurations", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations) })] + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get; set; } /// /// Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be /// used for generate configurations @@ -227,28 +241,39 @@ public partial interface ILinkerProperties : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be used for generate configurations", SerializedName = @"customizedKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys) })] + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get; set; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether to clean up previous operation when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? ConfigurationInfoDeleteOrUpdateBehavior { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string ConfigurationInfoDeleteOrUpdateBehavior { get; set; } /// Allow Azure services to access the target service if true. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Allow Azure services to access the target service if true.", SerializedName = @"azureServices", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? FirewallRuleAzureService { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + string FirewallRuleAzureService { get; set; } /// /// Allow caller client IP to access the target service if true. the property is used when connecting local application to /// target service. @@ -256,10 +281,14 @@ public partial interface ILinkerProperties : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Allow caller client IP to access the target service if true. the property is used when connecting local application to target service.", SerializedName = @"callerClientIP", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? FirewallRuleCallerClientIP { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + string FirewallRuleCallerClientIP { get; set; } /// /// This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client /// IPs for a given database account. @@ -267,14 +296,20 @@ public partial interface ILinkerProperties : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account.", SerializedName = @"ipRanges", PossibleTypes = new [] { typeof(string) })] - string[] FirewallRuleIPRange { get; set; } + System.Collections.Generic.List FirewallRuleIPRange { get; set; } /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state. ", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] @@ -286,24 +321,35 @@ public partial interface ILinkerProperties : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Optional. Indicates public network solution. If enable, enable public network access of target service with best try. Default is enable. If optOut, opt out public network access configuration.", SerializedName = @"action", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? PublicNetworkSolutionAction { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + string PublicNetworkSolutionAction { get; set; } /// /// Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? PublicNetworkSolutionDeleteOrUpdateBehavior { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string PublicNetworkSolutionDeleteOrUpdateBehavior { get; set; } /// connection scope in source service. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"connection scope in source service.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -312,6 +358,9 @@ public partial interface ILinkerProperties : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The key vault id to store secret", SerializedName = @"keyVaultId", PossibleTypes = new [] { typeof(string) })] @@ -320,6 +369,9 @@ public partial interface ILinkerProperties : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The key vault secret name to store secret, only valid when storing one secret", SerializedName = @"keyVaultSecretName", PossibleTypes = new [] { typeof(string) })] @@ -328,28 +380,39 @@ public partial interface ILinkerProperties : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The target service properties", SerializedName = @"targetService", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase TargetService { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase) })] + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase TargetService { get; set; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether to clean up previous operation when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? VNetSolutionDeleteOrUpdateBehavior { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string VNetSolutionDeleteOrUpdateBehavior { get; set; } /// Type of VNet solution. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of VNet solution.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType? VNetSolutionType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] + string VNetSolutionType { get; set; } } /// The properties of the Linker. @@ -357,79 +420,88 @@ internal partial interface ILinkerPropertiesInternal { /// The authentication type. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase AuthInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase AuthInfo { get; set; } /// The application client type - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType? ClientType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] + string ClientType { get; set; } /// /// The connection information consumed by applications, including secrets, connection strings. /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo ConfigurationInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo ConfigurationInfo { get; set; } /// /// Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied /// to the source application. Default is enable. If optOut, no configuration change will be made on source. /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? ConfigurationInfoAction { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + string ConfigurationInfoAction { get; set; } /// /// A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this /// property is to full fill more customized configurations /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get; set; } /// /// Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be /// used for generate configurations /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get; set; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? ConfigurationInfoDeleteOrUpdateBehavior { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string ConfigurationInfoDeleteOrUpdateBehavior { get; set; } /// Allow Azure services to access the target service if true. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? FirewallRuleAzureService { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + string FirewallRuleAzureService { get; set; } /// /// Allow caller client IP to access the target service if true. the property is used when connecting local application to /// target service. /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? FirewallRuleCallerClientIP { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + string FirewallRuleCallerClientIP { get; set; } /// /// This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client /// IPs for a given database account. /// - string[] FirewallRuleIPRange { get; set; } + System.Collections.Generic.List FirewallRuleIPRange { get; set; } /// The provisioning state. string ProvisioningState { get; set; } /// The network solution. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolution PublicNetworkSolution { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution PublicNetworkSolution { get; set; } /// /// Optional. Indicates public network solution. If enable, enable public network access of target service with best try. /// Default is enable. If optOut, opt out public network access configuration. /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? PublicNetworkSolutionAction { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + string PublicNetworkSolutionAction { get; set; } /// /// Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? PublicNetworkSolutionDeleteOrUpdateBehavior { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string PublicNetworkSolutionDeleteOrUpdateBehavior { get; set; } /// /// Describe firewall rules of target service to make sure source application could connect to the target. /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules PublicNetworkSolutionFirewallRule { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules PublicNetworkSolutionFirewallRule { get; set; } /// connection scope in source service. string Scope { get; set; } /// An option to store secret value in secure place - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStore SecretStore { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore SecretStore { get; set; } /// The key vault id to store secret string SecretStoreKeyVaultId { get; set; } /// The key vault secret name to store secret, only valid when storing one secret string SecretStoreKeyVaultSecretName { get; set; } /// The target service properties - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase TargetService { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase TargetService { get; set; } /// The VNet solution. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolution VNetSolution { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution VNetSolution { get; set; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? VNetSolutionDeleteOrUpdateBehavior { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string VNetSolutionDeleteOrUpdateBehavior { get; set; } /// Type of VNet solution. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType? VNetSolutionType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] + string VNetSolutionType { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerProperties.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerProperties.json.cs similarity index 89% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerProperties.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerProperties.json.cs index f2f02e6e1216..2d7fe6dcbac9 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerProperties.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class LinkerProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new LinkerProperties(json) : null; } @@ -77,15 +77,15 @@ internal LinkerProperties(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runti { return; } - {_vNetSolution = If( json?.PropertyT("vNetSolution"), out var __jsonVNetSolution) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.VNetSolution.FromJson(__jsonVNetSolution) : VNetSolution;} - {_secretStore = If( json?.PropertyT("secretStore"), out var __jsonSecretStore) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretStore.FromJson(__jsonSecretStore) : SecretStore;} - {_publicNetworkSolution = If( json?.PropertyT("publicNetworkSolution"), out var __jsonPublicNetworkSolution) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.PublicNetworkSolution.FromJson(__jsonPublicNetworkSolution) : PublicNetworkSolution;} - {_configurationInfo = If( json?.PropertyT("configurationInfo"), out var __jsonConfigurationInfo) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfo.FromJson(__jsonConfigurationInfo) : ConfigurationInfo;} - {_targetService = If( json?.PropertyT("targetService"), out var __jsonTargetService) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.TargetServiceBase.FromJson(__jsonTargetService) : TargetService;} - {_authInfo = If( json?.PropertyT("authInfo"), out var __jsonAuthInfo) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AuthInfoBase.FromJson(__jsonAuthInfo) : AuthInfo;} - {_clientType = If( json?.PropertyT("clientType"), out var __jsonClientType) ? (string)__jsonClientType : (string)ClientType;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} + {_vNetSolution = If( json?.PropertyT("vNetSolution"), out var __jsonVNetSolution) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.VNetSolution.FromJson(__jsonVNetSolution) : _vNetSolution;} + {_secretStore = If( json?.PropertyT("secretStore"), out var __jsonSecretStore) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretStore.FromJson(__jsonSecretStore) : _secretStore;} + {_publicNetworkSolution = If( json?.PropertyT("publicNetworkSolution"), out var __jsonPublicNetworkSolution) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.PublicNetworkSolution.FromJson(__jsonPublicNetworkSolution) : _publicNetworkSolution;} + {_configurationInfo = If( json?.PropertyT("configurationInfo"), out var __jsonConfigurationInfo) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfo.FromJson(__jsonConfigurationInfo) : _configurationInfo;} + {_targetService = If( json?.PropertyT("targetService"), out var __jsonTargetService) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.TargetServiceBase.FromJson(__jsonTargetService) : _targetService;} + {_authInfo = If( json?.PropertyT("authInfo"), out var __jsonAuthInfo) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AuthInfoBase.FromJson(__jsonAuthInfo) : _authInfo;} + {_clientType = If( json?.PropertyT("clientType"), out var __jsonClientType) ? (string)__jsonClientType : (string)_clientType;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} AfterFromJson(json); } @@ -115,7 +115,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode To AddIf( null != this._targetService ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) this._targetService.ToJson(null,serializationMode) : null, "targetService" ,container.Add ); AddIf( null != this._authInfo ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) this._authInfo.ToJson(null,serializationMode) : null, "authInfo" ,container.Add ); AddIf( null != (((object)this._clientType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString(this._clientType.ToString()) : null, "clientType" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerResource.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerResource.PowerShell.cs new file mode 100644 index 000000000000..2f210203b128 --- /dev/null +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerResource.PowerShell.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.ServiceLinker.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + + /// Linker of source and target resource + [System.ComponentModel.TypeConverter(typeof(LinkerResourceTypeConverter))] + public partial class LinkerResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LinkerResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LinkerResource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LinkerResource(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.ServiceLinker.Models.ILinkerResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SecretStore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).SecretStore = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore) content.GetValueForProperty("SecretStore",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).SecretStore, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretStoreTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ConfigurationInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo) content.GetValueForProperty("ConfigurationInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ConfigurationInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ClientType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ClientType = (string) content.GetValueForProperty("ClientType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ClientType, global::System.Convert.ToString); + } + if (content.Contains("VNetSolution")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).VNetSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution) content.GetValueForProperty("VNetSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).VNetSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.VNetSolutionTypeConverter.ConvertFrom); + } + if (content.Contains("PublicNetworkSolution")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).PublicNetworkSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution) content.GetValueForProperty("PublicNetworkSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).PublicNetworkSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.PublicNetworkSolutionTypeConverter.ConvertFrom); + } + if (content.Contains("TargetService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).TargetService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase) content.GetValueForProperty("TargetService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).TargetService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.TargetServiceBaseTypeConverter.ConvertFrom); + } + if (content.Contains("AuthInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).AuthInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase) content.GetValueForProperty("AuthInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).AuthInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AuthInfoBaseTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("VNetSolutionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).VNetSolutionType = (string) content.GetValueForProperty("VNetSolutionType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).VNetSolutionType, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkSolutionFirewallRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).PublicNetworkSolutionFirewallRule = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules) content.GetValueForProperty("PublicNetworkSolutionFirewallRule",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).PublicNetworkSolutionFirewallRule, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.FirewallRulesTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationInfoCustomizedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ConfigurationInfoCustomizedKey = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys) content.GetValueForProperty("ConfigurationInfoCustomizedKey",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ConfigurationInfoCustomizedKey, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoCustomizedKeysTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationInfoAdditionalConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ConfigurationInfoAdditionalConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations) content.GetValueForProperty("ConfigurationInfoAdditionalConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ConfigurationInfoAdditionalConfiguration, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoAdditionalConfigurationsTypeConverter.ConvertFrom); + } + if (content.Contains("VNetSolutionDeleteOrUpdateBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).VNetSolutionDeleteOrUpdateBehavior = (string) content.GetValueForProperty("VNetSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).VNetSolutionDeleteOrUpdateBehavior, global::System.Convert.ToString); + } + if (content.Contains("SecretStoreKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).SecretStoreKeyVaultId = (string) content.GetValueForProperty("SecretStoreKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).SecretStoreKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("SecretStoreKeyVaultSecretName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).SecretStoreKeyVaultSecretName = (string) content.GetValueForProperty("SecretStoreKeyVaultSecretName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).SecretStoreKeyVaultSecretName, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkSolutionDeleteOrUpdateBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior = (string) content.GetValueForProperty("PublicNetworkSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkSolutionAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).PublicNetworkSolutionAction = (string) content.GetValueForProperty("PublicNetworkSolutionAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).PublicNetworkSolutionAction, global::System.Convert.ToString); + } + if (content.Contains("FirewallRuleIPRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).FirewallRuleIPRange = (System.Collections.Generic.List) content.GetValueForProperty("FirewallRuleIPRange",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).FirewallRuleIPRange, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ConfigurationInfoDeleteOrUpdateBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ConfigurationInfoDeleteOrUpdateBehavior = (string) content.GetValueForProperty("ConfigurationInfoDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ConfigurationInfoDeleteOrUpdateBehavior, global::System.Convert.ToString); + } + if (content.Contains("ConfigurationInfoAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ConfigurationInfoAction = (string) content.GetValueForProperty("ConfigurationInfoAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ConfigurationInfoAction, global::System.Convert.ToString); + } + if (content.Contains("FirewallRuleAzureService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).FirewallRuleAzureService = (string) content.GetValueForProperty("FirewallRuleAzureService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).FirewallRuleAzureService, global::System.Convert.ToString); + } + if (content.Contains("FirewallRuleCallerClientIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).FirewallRuleCallerClientIP = (string) content.GetValueForProperty("FirewallRuleCallerClientIP",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).FirewallRuleCallerClientIP, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal LinkerResource(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.ServiceLinker.Models.ILinkerResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SecretStore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).SecretStore = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore) content.GetValueForProperty("SecretStore",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).SecretStore, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretStoreTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ConfigurationInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo) content.GetValueForProperty("ConfigurationInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ConfigurationInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ClientType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ClientType = (string) content.GetValueForProperty("ClientType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ClientType, global::System.Convert.ToString); + } + if (content.Contains("VNetSolution")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).VNetSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution) content.GetValueForProperty("VNetSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).VNetSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.VNetSolutionTypeConverter.ConvertFrom); + } + if (content.Contains("PublicNetworkSolution")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).PublicNetworkSolution = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution) content.GetValueForProperty("PublicNetworkSolution",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).PublicNetworkSolution, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.PublicNetworkSolutionTypeConverter.ConvertFrom); + } + if (content.Contains("TargetService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).TargetService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase) content.GetValueForProperty("TargetService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).TargetService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.TargetServiceBaseTypeConverter.ConvertFrom); + } + if (content.Contains("AuthInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).AuthInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase) content.GetValueForProperty("AuthInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).AuthInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AuthInfoBaseTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("VNetSolutionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).VNetSolutionType = (string) content.GetValueForProperty("VNetSolutionType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).VNetSolutionType, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkSolutionFirewallRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).PublicNetworkSolutionFirewallRule = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules) content.GetValueForProperty("PublicNetworkSolutionFirewallRule",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).PublicNetworkSolutionFirewallRule, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.FirewallRulesTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationInfoCustomizedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ConfigurationInfoCustomizedKey = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys) content.GetValueForProperty("ConfigurationInfoCustomizedKey",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ConfigurationInfoCustomizedKey, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoCustomizedKeysTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationInfoAdditionalConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ConfigurationInfoAdditionalConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations) content.GetValueForProperty("ConfigurationInfoAdditionalConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ConfigurationInfoAdditionalConfiguration, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfoAdditionalConfigurationsTypeConverter.ConvertFrom); + } + if (content.Contains("VNetSolutionDeleteOrUpdateBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).VNetSolutionDeleteOrUpdateBehavior = (string) content.GetValueForProperty("VNetSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).VNetSolutionDeleteOrUpdateBehavior, global::System.Convert.ToString); + } + if (content.Contains("SecretStoreKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).SecretStoreKeyVaultId = (string) content.GetValueForProperty("SecretStoreKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).SecretStoreKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("SecretStoreKeyVaultSecretName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).SecretStoreKeyVaultSecretName = (string) content.GetValueForProperty("SecretStoreKeyVaultSecretName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).SecretStoreKeyVaultSecretName, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkSolutionDeleteOrUpdateBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior = (string) content.GetValueForProperty("PublicNetworkSolutionDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).PublicNetworkSolutionDeleteOrUpdateBehavior, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkSolutionAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).PublicNetworkSolutionAction = (string) content.GetValueForProperty("PublicNetworkSolutionAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).PublicNetworkSolutionAction, global::System.Convert.ToString); + } + if (content.Contains("FirewallRuleIPRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).FirewallRuleIPRange = (System.Collections.Generic.List) content.GetValueForProperty("FirewallRuleIPRange",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).FirewallRuleIPRange, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ConfigurationInfoDeleteOrUpdateBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ConfigurationInfoDeleteOrUpdateBehavior = (string) content.GetValueForProperty("ConfigurationInfoDeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ConfigurationInfoDeleteOrUpdateBehavior, global::System.Convert.ToString); + } + if (content.Contains("ConfigurationInfoAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ConfigurationInfoAction = (string) content.GetValueForProperty("ConfigurationInfoAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).ConfigurationInfoAction, global::System.Convert.ToString); + } + if (content.Contains("FirewallRuleAzureService")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).FirewallRuleAzureService = (string) content.GetValueForProperty("FirewallRuleAzureService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).FirewallRuleAzureService, global::System.Convert.ToString); + } + if (content.Contains("FirewallRuleCallerClientIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).FirewallRuleCallerClientIP = (string) content.GetValueForProperty("FirewallRuleCallerClientIP",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal)this).FirewallRuleCallerClientIP, 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.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Linker of source and target resource + [System.ComponentModel.TypeConverter(typeof(LinkerResourceTypeConverter))] + public partial interface ILinkerResource + + { + + } +} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerResource.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerResource.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerResource.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerResource.TypeConverter.cs index 202c44e63e01..e12f641627df 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerResource.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerResource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerResource.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerResource.cs similarity index 54% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerResource.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerResource.cs index 00d860ad63e3..29626c0507ad 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerResource.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerResource.cs @@ -3,203 +3,225 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// Linker of source and target resource public partial class LinkerResource : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ProxyResource(); /// The authentication type. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase AuthInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).AuthInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).AuthInfo = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase AuthInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).AuthInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).AuthInfo = value ?? null /* model class */; } /// The application client type [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType? ClientType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ClientType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ClientType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType)""); } + public string ClientType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ClientType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ClientType = value ?? null; } /// /// Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied /// to the source application. Default is enable. If optOut, no configuration change will be made on source. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? ConfigurationInfoAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ConfigurationInfoAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ConfigurationInfoAction = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType)""); } + public string ConfigurationInfoAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ConfigurationInfoAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ConfigurationInfoAction = value ?? null; } /// /// A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this /// property is to full fill more customized configurations /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ConfigurationInfoAdditionalConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ConfigurationInfoAdditionalConfiguration = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ConfigurationInfoAdditionalConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ConfigurationInfoAdditionalConfiguration = value ?? null /* model class */; } /// /// Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be /// used for generate configurations /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ConfigurationInfoCustomizedKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ConfigurationInfoCustomizedKey = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ConfigurationInfoCustomizedKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ConfigurationInfoCustomizedKey = value ?? null /* model class */; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? ConfigurationInfoDeleteOrUpdateBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ConfigurationInfoDeleteOrUpdateBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ConfigurationInfoDeleteOrUpdateBehavior = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior)""); } + public string ConfigurationInfoDeleteOrUpdateBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ConfigurationInfoDeleteOrUpdateBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ConfigurationInfoDeleteOrUpdateBehavior = value ?? null; } /// Allow Azure services to access the target service if true. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? FirewallRuleAzureService { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).FirewallRuleAzureService; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).FirewallRuleAzureService = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType)""); } + public string FirewallRuleAzureService { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).FirewallRuleAzureService; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).FirewallRuleAzureService = value ?? null; } /// /// Allow caller client IP to access the target service if true. the property is used when connecting local application to /// target service. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? FirewallRuleCallerClientIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).FirewallRuleCallerClientIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).FirewallRuleCallerClientIP = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType)""); } + public string FirewallRuleCallerClientIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).FirewallRuleCallerClientIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).FirewallRuleCallerClientIP = value ?? null; } /// /// This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client /// IPs for a given database account. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string[] FirewallRuleIPRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).FirewallRuleIPRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).FirewallRuleIPRange = value ?? null /* arrayOf */; } + public System.Collections.Generic.List FirewallRuleIPRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).FirewallRuleIPRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).FirewallRuleIPRange = value ?? null /* arrayOf */; } /// /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).Id; } /// Internal Acessors for ConfigurationInfo - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal.ConfigurationInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ConfigurationInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ConfigurationInfo = value; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal.ConfigurationInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ConfigurationInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ConfigurationInfo = value ?? null /* model class */; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerProperties Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerProperties Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ProvisioningState = value ?? null; } /// Internal Acessors for PublicNetworkSolution - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolution Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal.PublicNetworkSolution { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).PublicNetworkSolution; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).PublicNetworkSolution = value; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal.PublicNetworkSolution { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).PublicNetworkSolution; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).PublicNetworkSolution = value ?? null /* model class */; } /// Internal Acessors for PublicNetworkSolutionFirewallRule - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal.PublicNetworkSolutionFirewallRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).PublicNetworkSolutionFirewallRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).PublicNetworkSolutionFirewallRule = value; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal.PublicNetworkSolutionFirewallRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).PublicNetworkSolutionFirewallRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).PublicNetworkSolutionFirewallRule = value ?? null /* model class */; } /// Internal Acessors for SecretStore - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStore Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal.SecretStore { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).SecretStore; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).SecretStore = value; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal.SecretStore { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).SecretStore; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).SecretStore = value ?? null /* model class */; } /// Internal Acessors for VNetSolution - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolution Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResourceInternal.VNetSolution { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).VNetSolution; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).VNetSolution = value; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResourceInternal.VNetSolution { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).VNetSolution; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).VNetSolution = value ?? null /* model class */; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).Name = value ?? null; } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemData = value; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedByType = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).Type = value ?? null; } /// The name of the resource [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerProperties _property; /// The properties of the Linker. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerProperties()); set => this._property = value; } /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).ProvisioningState; } /// /// Optional. Indicates public network solution. If enable, enable public network access of target service with best try. /// Default is enable. If optOut, opt out public network access configuration. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? PublicNetworkSolutionAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).PublicNetworkSolutionAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).PublicNetworkSolutionAction = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType)""); } + public string PublicNetworkSolutionAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).PublicNetworkSolutionAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).PublicNetworkSolutionAction = value ?? null; } /// /// Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? PublicNetworkSolutionDeleteOrUpdateBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).PublicNetworkSolutionDeleteOrUpdateBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).PublicNetworkSolutionDeleteOrUpdateBehavior = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior)""); } + public string PublicNetworkSolutionDeleteOrUpdateBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).PublicNetworkSolutionDeleteOrUpdateBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).PublicNetworkSolutionDeleteOrUpdateBehavior = value ?? null; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } /// connection scope in source service. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).Scope = value ?? null; } + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).Scope = value ?? null; } /// The key vault id to store secret [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string SecretStoreKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).SecretStoreKeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).SecretStoreKeyVaultId = value ?? null; } + public string SecretStoreKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).SecretStoreKeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).SecretStoreKeyVaultId = value ?? null; } /// The key vault secret name to store secret, only valid when storing one secret [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string SecretStoreKeyVaultSecretName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).SecretStoreKeyVaultSecretName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).SecretStoreKeyVaultSecretName = value ?? null; } + public string SecretStoreKeyVaultSecretName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).SecretStoreKeyVaultSecretName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).SecretStoreKeyVaultSecretName = value ?? null; } /// /// Azure Resource Manager metadata containing createdBy and modifiedBy information. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemData; } + internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemData = value ?? null /* model class */; } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataCreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataCreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataCreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataCreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataLastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedByType; } /// The target service properties [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase TargetService { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).TargetService; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).TargetService = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase TargetService { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).TargetService; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).TargetService = value ?? null /* model class */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__proxyResource).Type; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? VNetSolutionDeleteOrUpdateBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).VNetSolutionDeleteOrUpdateBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).VNetSolutionDeleteOrUpdateBehavior = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior)""); } + public string VNetSolutionDeleteOrUpdateBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).VNetSolutionDeleteOrUpdateBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).VNetSolutionDeleteOrUpdateBehavior = value ?? null; } /// Type of VNet solution. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType? VNetSolutionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).VNetSolutionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPropertiesInternal)Property).VNetSolutionType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType)""); } + public string VNetSolutionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).VNetSolutionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPropertiesInternal)Property).VNetSolutionType = value ?? null; } /// Creates an new instance. public LinkerResource() @@ -215,31 +237,38 @@ public LinkerResource() /// public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) { - await eventListener.AssertNotNull(nameof(__resource), __resource); - await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); } } /// Linker of source and target resource public partial interface ILinkerResource : Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResource + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IProxyResource { /// The authentication type. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The authentication type.", SerializedName = @"authInfo", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase AuthInfo { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase) })] + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase AuthInfo { get; set; } /// The application client type [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The application client type", SerializedName = @"clientType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType? ClientType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] + string ClientType { get; set; } /// /// Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied /// to the source application. Default is enable. If optOut, no configuration change will be made on source. @@ -247,10 +276,14 @@ public partial interface ILinkerResource : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied to the source application. Default is enable. If optOut, no configuration change will be made on source.", SerializedName = @"action", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? ConfigurationInfoAction { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + string ConfigurationInfoAction { get; set; } /// /// A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this /// property is to full fill more customized configurations @@ -258,10 +291,13 @@ public partial interface ILinkerResource : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this property is to full fill more customized configurations", SerializedName = @"additionalConfigurations", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations) })] + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get; set; } /// /// Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be /// used for generate configurations @@ -269,28 +305,39 @@ public partial interface ILinkerResource : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be used for generate configurations", SerializedName = @"customizedKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys) })] + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get; set; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether to clean up previous operation when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? ConfigurationInfoDeleteOrUpdateBehavior { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string ConfigurationInfoDeleteOrUpdateBehavior { get; set; } /// Allow Azure services to access the target service if true. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Allow Azure services to access the target service if true.", SerializedName = @"azureServices", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? FirewallRuleAzureService { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + string FirewallRuleAzureService { get; set; } /// /// Allow caller client IP to access the target service if true. the property is used when connecting local application to /// target service. @@ -298,10 +345,14 @@ public partial interface ILinkerResource : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Allow caller client IP to access the target service if true. the property is used when connecting local application to target service.", SerializedName = @"callerClientIP", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? FirewallRuleCallerClientIP { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + string FirewallRuleCallerClientIP { get; set; } /// /// This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client /// IPs for a given database account. @@ -309,14 +360,20 @@ public partial interface ILinkerResource : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account.", SerializedName = @"ipRanges", PossibleTypes = new [] { typeof(string) })] - string[] FirewallRuleIPRange { get; set; } + System.Collections.Generic.List FirewallRuleIPRange { get; set; } /// The provisioning state. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state. ", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] @@ -328,24 +385,35 @@ public partial interface ILinkerResource : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Optional. Indicates public network solution. If enable, enable public network access of target service with best try. Default is enable. If optOut, opt out public network access configuration.", SerializedName = @"action", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? PublicNetworkSolutionAction { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + string PublicNetworkSolutionAction { get; set; } /// /// Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? PublicNetworkSolutionDeleteOrUpdateBehavior { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string PublicNetworkSolutionDeleteOrUpdateBehavior { get; set; } /// connection scope in source service. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"connection scope in source service.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -354,6 +422,9 @@ public partial interface ILinkerResource : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The key vault id to store secret", SerializedName = @"keyVaultId", PossibleTypes = new [] { typeof(string) })] @@ -362,6 +433,9 @@ public partial interface ILinkerResource : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The key vault secret name to store secret, only valid when storing one secret", SerializedName = @"keyVaultSecretName", PossibleTypes = new [] { typeof(string) })] @@ -370,110 +444,130 @@ public partial interface ILinkerResource : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The target service properties", SerializedName = @"targetService", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase TargetService { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase) })] + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase TargetService { get; set; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether to clean up previous operation when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? VNetSolutionDeleteOrUpdateBehavior { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string VNetSolutionDeleteOrUpdateBehavior { get; set; } /// Type of VNet solution. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of VNet solution.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType? VNetSolutionType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] + string VNetSolutionType { get; set; } } /// Linker of source and target resource internal partial interface ILinkerResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IProxyResourceInternal { /// The authentication type. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase AuthInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase AuthInfo { get; set; } /// The application client type - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType? ClientType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] + string ClientType { get; set; } /// /// The connection information consumed by applications, including secrets, connection strings. /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo ConfigurationInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo ConfigurationInfo { get; set; } /// /// Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied /// to the source application. Default is enable. If optOut, no configuration change will be made on source. /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? ConfigurationInfoAction { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + string ConfigurationInfoAction { get; set; } /// /// A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this /// property is to full fill more customized configurations /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get; set; } /// /// Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be /// used for generate configurations /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get; set; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? ConfigurationInfoDeleteOrUpdateBehavior { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string ConfigurationInfoDeleteOrUpdateBehavior { get; set; } /// Allow Azure services to access the target service if true. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? FirewallRuleAzureService { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + string FirewallRuleAzureService { get; set; } /// /// Allow caller client IP to access the target service if true. the property is used when connecting local application to /// target service. /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? FirewallRuleCallerClientIP { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + string FirewallRuleCallerClientIP { get; set; } /// /// This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client /// IPs for a given database account. /// - string[] FirewallRuleIPRange { get; set; } + System.Collections.Generic.List FirewallRuleIPRange { get; set; } /// The properties of the Linker. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerProperties Property { get; set; } /// The provisioning state. string ProvisioningState { get; set; } /// The network solution. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolution PublicNetworkSolution { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution PublicNetworkSolution { get; set; } /// /// Optional. Indicates public network solution. If enable, enable public network access of target service with best try. /// Default is enable. If optOut, opt out public network access configuration. /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? PublicNetworkSolutionAction { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + string PublicNetworkSolutionAction { get; set; } /// /// Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? PublicNetworkSolutionDeleteOrUpdateBehavior { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string PublicNetworkSolutionDeleteOrUpdateBehavior { get; set; } /// /// Describe firewall rules of target service to make sure source application could connect to the target. /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules PublicNetworkSolutionFirewallRule { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules PublicNetworkSolutionFirewallRule { get; set; } /// connection scope in source service. string Scope { get; set; } /// An option to store secret value in secure place - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStore SecretStore { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore SecretStore { get; set; } /// The key vault id to store secret string SecretStoreKeyVaultId { get; set; } /// The key vault secret name to store secret, only valid when storing one secret string SecretStoreKeyVaultSecretName { get; set; } /// The target service properties - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase TargetService { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase TargetService { get; set; } /// The VNet solution. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolution VNetSolution { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution VNetSolution { get; set; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? VNetSolutionDeleteOrUpdateBehavior { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string VNetSolutionDeleteOrUpdateBehavior { get; set; } /// Type of VNet solution. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType? VNetSolutionType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] + string VNetSolutionType { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerResource.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerResource.json.cs similarity index 92% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerResource.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerResource.json.cs index fd2460f08251..89c2d0600d7b 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/LinkerResource.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/LinkerResource.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class LinkerResource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new LinkerResource(json) : null; } @@ -77,8 +77,8 @@ internal LinkerResource(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerProperties.FromJson(__jsonProperties) : Property;} + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } @@ -101,7 +101,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode To { return container; } - __resource?.ToJson(container, serializationMode); + __proxyResource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); AfterToJson(ref container); return container; diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/Operation.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Operation.PowerShell.cs similarity index 61% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/Operation.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Operation.PowerShell.cs index b670f34cbd18..2d3d8755a166 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/Operation.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Operation.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -57,27 +57,35 @@ public partial class Operation partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Operation(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Operation(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOpe /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,45 +113,45 @@ internal Operation(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.OperationDisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.OperationDisplayTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("IsDataAction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Origin")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).Origin = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.Origin?) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).Origin, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.Origin.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).Origin, global::System.Convert.ToString); } if (content.Contains("ActionType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).ActionType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType?) content.GetValueForProperty("ActionType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).ActionType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).ActionType = (string) content.GetValueForProperty("ActionType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).ActionType, global::System.Convert.ToString); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -158,39 +166,39 @@ internal Operation(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.OperationDisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.OperationDisplayTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("IsDataAction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Origin")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).Origin = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.Origin?) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).Origin, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.Origin.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).Origin, global::System.Convert.ToString); } if (content.Contains("ActionType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).ActionType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType?) content.GetValueForProperty("ActionType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).ActionType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).ActionType = (string) content.GetValueForProperty("ActionType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).ActionType, global::System.Convert.ToString); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -199,6 +207,18 @@ internal Operation(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Details of a REST API operation, returned from the Resource Provider Operations API [System.ComponentModel.TypeConverter(typeof(OperationTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/Operation.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Operation.TypeConverter.cs similarity index 98% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/Operation.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Operation.TypeConverter.cs index ef3b8588c854..e370d2a8226c 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/Operation.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Operation.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/Operation.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Operation.cs similarity index 76% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/Operation.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Operation.cs index a71cb198cabe..634dd3c697bb 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/Operation.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Operation.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -11,50 +11,50 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 /// Details of a REST API operation, returned from the Resource Provider Operations API /// public partial class Operation : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperation, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperation, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? _actionType; + private string _actionType; /// /// Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? ActionType { get => this._actionType; } + public string ActionType { get => this._actionType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplay _display; + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplay _display; /// Localized display information for this particular operation. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.OperationDisplay()); set => this._display = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.OperationDisplay()); set => this._display = value; } /// /// The short, localized friendly description of the operation; suitable for tool tips and detailed views. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)Display).Description; } + public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)Display).Description; } /// /// The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", /// "Restart Virtual Machine". /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)Display).Operation; } + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)Display).Operation; } /// /// The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)Display).Provider; } + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)Display).Provider; } /// /// The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)Display).Resource; } + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)Display).Resource; } /// Backing field for property. private bool? _isDataAction; @@ -67,31 +67,31 @@ public partial class Operation : public bool? IsDataAction { get => this._isDataAction; } /// Internal Acessors for ActionType - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal.ActionType { get => this._actionType; set { {_actionType = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal.ActionType { get => this._actionType; set { {_actionType = value;} } } /// Internal Acessors for Display - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.OperationDisplay()); set { {_display = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.OperationDisplay()); set { {_display = value;} } } /// Internal Acessors for DisplayDescription - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal.DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)Display).Description = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal.DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)Display).Description = value ?? null; } /// Internal Acessors for DisplayOperation - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal.DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)Display).Operation = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal.DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)Display).Operation = value ?? null; } /// Internal Acessors for DisplayProvider - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal.DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)Display).Provider = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal.DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)Display).Provider = value ?? null; } /// Internal Acessors for DisplayResource - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal.DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)Display).Resource = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal.DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)Display).Resource = value ?? null; } /// Internal Acessors for IsDataAction - bool? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal.IsDataAction { get => this._isDataAction; set { {_isDataAction = value;} } } + bool? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal.IsDataAction { get => this._isDataAction; set { {_isDataAction = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Origin - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.Origin? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationInternal.Origin { get => this._origin; set { {_origin = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationInternal.Origin { get => this._origin; set { {_origin = value;} } } /// Backing field for property. private string _name; @@ -104,14 +104,14 @@ public partial class Operation : public string Name { get => this._name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.Origin? _origin; + private string _origin; /// /// The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is /// "user,system" /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.Origin? Origin { get => this._origin; } + public string Origin { get => this._origin; } /// Creates an new instance. public Operation() @@ -129,16 +129,23 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Enum. Indicates the action type. ""Internal"" refers to actions that are for internal only APIs.", SerializedName = @"actionType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? ActionType { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + string ActionType { get; } /// /// The short, localized friendly description of the operation; suitable for tool tips and detailed views. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The short, localized friendly description of the operation; suitable for tool tips and detailed views.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -150,6 +157,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The concise, localized friendly name for the operation; suitable for dropdowns. E.g. ""Create or Update Virtual Machine"", ""Restart Virtual Machine"".", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -160,6 +170,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The localized friendly form of the resource provider name, e.g. ""Microsoft Monitoring Insights"" or ""Microsoft Compute"".", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -170,6 +183,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The localized friendly name of the resource type related to this operation. E.g. ""Virtual Machines"" or ""Job Schedule Collections"".", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] @@ -181,6 +197,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Whether the operation applies to data-plane. This is ""true"" for data-plane operations and ""false"" for ARM/control-plane operations.", SerializedName = @"isDataAction", PossibleTypes = new [] { typeof(bool) })] @@ -192,6 +211,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the operation, as per Resource-Based Access Control (RBAC). Examples: ""Microsoft.Compute/virtualMachines/write"", ""Microsoft.Compute/virtualMachines/capture/action""", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -203,10 +225,14 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is ""user,system""", SerializedName = @"origin", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.Origin) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.Origin? Origin { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("user", "system", "user,system")] + string Origin { get; } } /// Details of a REST API operation, returned from the Resource Provider Operations API @@ -216,9 +242,10 @@ internal partial interface IOperationInternal /// /// Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? ActionType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + string ActionType { get; set; } /// Localized display information for this particular operation. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplay Display { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplay Display { get; set; } /// /// The short, localized friendly description of the operation; suitable for tool tips and detailed views. /// @@ -250,7 +277,8 @@ internal partial interface IOperationInternal /// The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is /// "user,system" /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.Origin? Origin { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("user", "system", "user,system")] + string Origin { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/Operation.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Operation.json.cs similarity index 94% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/Operation.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Operation.json.cs index 937a84cba627..b098bae583d4 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/Operation.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Operation.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class Operation partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperation. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperation. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperation. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new Operation(json) : null; } @@ -79,11 +79,11 @@ internal Operation(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json { return; } - {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.OperationDisplay.FromJson(__jsonDisplay) : Display;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_isDataAction = If( json?.PropertyT("isDataAction"), out var __jsonIsDataAction) ? (bool?)__jsonIsDataAction : IsDataAction;} - {_origin = If( json?.PropertyT("origin"), out var __jsonOrigin) ? (string)__jsonOrigin : (string)Origin;} - {_actionType = If( json?.PropertyT("actionType"), out var __jsonActionType) ? (string)__jsonActionType : (string)ActionType;} + {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.OperationDisplay.FromJson(__jsonDisplay) : _display;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_isDataAction = If( json?.PropertyT("isDataAction"), out var __jsonIsDataAction) ? (bool?)__jsonIsDataAction : _isDataAction;} + {_origin = If( json?.PropertyT("origin"), out var __jsonOrigin) ? (string)__jsonOrigin : (string)_origin;} + {_actionType = If( json?.PropertyT("actionType"), out var __jsonActionType) ? (string)__jsonActionType : (string)_actionType;} AfterFromJson(json); } @@ -107,19 +107,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode To return container; } AddIf( null != this._display ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) this._display.ToJson(null,serializationMode) : null, "display" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._isDataAction ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonBoolean((bool)this._isDataAction) : null, "isDataAction" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._origin)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString(this._origin.ToString()) : null, "origin" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._actionType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString(this._actionType.ToString()) : null, "actionType" ,container.Add ); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/OperationDisplay.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs similarity index 69% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/OperationDisplay.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs index fe8f9d5533f2..75e36fa581d6 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/OperationDisplay.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class OperationDisplay partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationDisplay(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationDisplay(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOpe /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,25 +111,25 @@ internal OperationDisplay(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Provider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,19 +144,19 @@ internal OperationDisplay(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Provider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -157,6 +165,18 @@ internal OperationDisplay(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Localized display information for this particular operation. [System.ComponentModel.TypeConverter(typeof(OperationDisplayTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/OperationDisplay.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs similarity index 98% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/OperationDisplay.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs index ee0ab355a31e..e905432da053 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/OperationDisplay.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplay ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplay ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplay).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplay).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/OperationDisplay.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/OperationDisplay.cs similarity index 90% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/OperationDisplay.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/OperationDisplay.cs index eff581f5919d..095b49c4fcb1 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/OperationDisplay.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/OperationDisplay.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// Localized display information for this particular operation. public partial class OperationDisplay : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplay, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplay, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal { /// Backing field for property. @@ -23,16 +23,16 @@ public partial class OperationDisplay : public string Description { get => this._description; } /// Internal Acessors for Description - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal.Description { get => this._description; set { {_description = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal.Description { get => this._description; set { {_description = value;} } } /// Internal Acessors for Operation - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal.Operation { get => this._operation; set { {_operation = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal.Operation { get => this._operation; set { {_operation = value;} } } /// Internal Acessors for Provider - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal.Provider { get => this._provider; set { {_provider = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal.Provider { get => this._provider; set { {_provider = value;} } } /// Internal Acessors for Resource - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplayInternal.Resource { get => this._resource; set { {_resource = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplayInternal.Resource { get => this._resource; set { {_resource = value;} } } /// Backing field for property. private string _operation; @@ -78,6 +78,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The short, localized friendly description of the operation; suitable for tool tips and detailed views.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -89,6 +92,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The concise, localized friendly name for the operation; suitable for dropdowns. E.g. ""Create or Update Virtual Machine"", ""Restart Virtual Machine"".", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -99,6 +105,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The localized friendly form of the resource provider name, e.g. ""Microsoft Monitoring Insights"" or ""Microsoft Compute"".", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -109,6 +118,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The localized friendly name of the resource type related to this operation. E.g. ""Virtual Machines"" or ""Job Schedule Collections"".", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/OperationDisplay.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/OperationDisplay.json.cs similarity index 94% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/OperationDisplay.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/OperationDisplay.json.cs index e4d65414adea..b50018785089 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/OperationDisplay.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/OperationDisplay.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationDisplay partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplay. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplay. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplay. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplay. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new OperationDisplay(json) : null; } @@ -77,10 +77,10 @@ internal OperationDisplay(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runti { return; } - {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)Provider;} - {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)Resource;} - {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)_provider;} + {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)_resource;} + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)_operation;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} AfterFromJson(json); } @@ -103,19 +103,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode To { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/OperationListResult.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/OperationListResult.PowerShell.cs similarity index 71% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/OperationListResult.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/OperationListResult.PowerShell.cs index 51d9ac554f2b..2fc3f785f040 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/OperationListResult.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/OperationListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -58,27 +58,35 @@ public partial class OperationListResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationListResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationListResult(content); } @@ -88,10 +96,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOpe /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -106,17 +114,17 @@ internal OperationListResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.OperationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.OperationTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -131,11 +139,11 @@ internal OperationListResult(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.OperationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.OperationTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -144,6 +152,18 @@ internal OperationListResult(global::System.Management.Automation.PSObject conte /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of /// results. diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/OperationListResult.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs similarity index 98% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/OperationListResult.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs index 92d8c7afed02..ee99595ffbb0 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/OperationListResult.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/OperationListResult.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/OperationListResult.cs similarity index 75% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/OperationListResult.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/OperationListResult.cs index c06c7c6805b0..24fc1ffad133 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/OperationListResult.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/OperationListResult.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -12,15 +12,15 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 /// results. /// public partial class OperationListResult : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationListResult, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationListResult, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationListResultInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperation[] Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationListResultInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationListResultInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -30,11 +30,11 @@ public partial class OperationListResult : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperation[] _value; + private System.Collections.Generic.List _value; /// List of operations supported by the resource provider [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperation[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public OperationListResult() @@ -51,6 +51,9 @@ public partial interface IOperationListResult : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next set of operation list results (if there are any).", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -59,10 +62,13 @@ public partial interface IOperationListResult : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"List of operations supported by the resource provider", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperation) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperation[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperation) })] + System.Collections.Generic.List Value { get; } } /// A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of @@ -73,7 +79,7 @@ internal partial interface IOperationListResultInternal /// URL to get the next set of operation list results (if there are any). string NextLink { get; set; } /// List of operations supported by the resource provider - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperation[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/OperationListResult.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/OperationListResult.json.cs similarity index 91% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/OperationListResult.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/OperationListResult.json.cs index b6c389de7b08..4420ef90d281 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/OperationListResult.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/OperationListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -57,13 +57,13 @@ public partial class OperationListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new OperationListResult(json) : null; } @@ -80,8 +80,8 @@ internal OperationListResult(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Ru { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Models.Api30.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.Operation.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Operation.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } @@ -104,7 +104,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode To { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -116,7 +116,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode To container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/PermissionsMissingDryrunPrerequisiteResult.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/PermissionsMissingDryrunPrerequisiteResult.PowerShell.cs similarity index 66% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/PermissionsMissingDryrunPrerequisiteResult.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/PermissionsMissingDryrunPrerequisiteResult.PowerShell.cs index e39319887d48..380c7259b4e7 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/PermissionsMissingDryrunPrerequisiteResult.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/PermissionsMissingDryrunPrerequisiteResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class PermissionsMissingDryrunPrerequisiteResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPermissionsMissingDryrunPrerequisiteResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPermissionsMissingDryrunPrerequisiteResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PermissionsMissingDryrunPrerequisiteResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPermissionsMissingDryrunPrerequisiteResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPermissionsMissingDryrunPrerequisiteResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PermissionsMissingDryrunPrerequisiteResult(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPermissionsMissingDryrunPrerequisiteResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPermissionsMissingDryrunPrerequisiteResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -108,25 +116,25 @@ internal PermissionsMissingDryrunPrerequisiteResult(global::System.Collections.I // actually deserialize if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPermissionsMissingDryrunPrerequisiteResultInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPermissionsMissingDryrunPrerequisiteResultInternal)this).Scope, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPermissionsMissingDryrunPrerequisiteResultInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPermissionsMissingDryrunPrerequisiteResultInternal)this).Scope, global::System.Convert.ToString); } if (content.Contains("Permission")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPermissionsMissingDryrunPrerequisiteResultInternal)this).Permission = (string[]) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPermissionsMissingDryrunPrerequisiteResultInternal)this).Permission, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPermissionsMissingDryrunPrerequisiteResultInternal)this).Permission = (System.Collections.Generic.List) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPermissionsMissingDryrunPrerequisiteResultInternal)this).Permission, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("RecommendedRole")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPermissionsMissingDryrunPrerequisiteResultInternal)this).RecommendedRole = (string) content.GetValueForProperty("RecommendedRole",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPermissionsMissingDryrunPrerequisiteResultInternal)this).RecommendedRole, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPermissionsMissingDryrunPrerequisiteResultInternal)this).RecommendedRole = (string) content.GetValueForProperty("RecommendedRole",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPermissionsMissingDryrunPrerequisiteResultInternal)this).RecommendedRole, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResultInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPrerequisiteResultType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResultInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPrerequisiteResultType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResultInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResultInternal)this).Type, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -141,19 +149,19 @@ internal PermissionsMissingDryrunPrerequisiteResult(global::System.Management.Au // actually deserialize if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPermissionsMissingDryrunPrerequisiteResultInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPermissionsMissingDryrunPrerequisiteResultInternal)this).Scope, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPermissionsMissingDryrunPrerequisiteResultInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPermissionsMissingDryrunPrerequisiteResultInternal)this).Scope, global::System.Convert.ToString); } if (content.Contains("Permission")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPermissionsMissingDryrunPrerequisiteResultInternal)this).Permission = (string[]) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPermissionsMissingDryrunPrerequisiteResultInternal)this).Permission, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPermissionsMissingDryrunPrerequisiteResultInternal)this).Permission = (System.Collections.Generic.List) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPermissionsMissingDryrunPrerequisiteResultInternal)this).Permission, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("RecommendedRole")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPermissionsMissingDryrunPrerequisiteResultInternal)this).RecommendedRole = (string) content.GetValueForProperty("RecommendedRole",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPermissionsMissingDryrunPrerequisiteResultInternal)this).RecommendedRole, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPermissionsMissingDryrunPrerequisiteResultInternal)this).RecommendedRole = (string) content.GetValueForProperty("RecommendedRole",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPermissionsMissingDryrunPrerequisiteResultInternal)this).RecommendedRole, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResultInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPrerequisiteResultType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResultInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPrerequisiteResultType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResultInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResultInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -162,6 +170,18 @@ internal PermissionsMissingDryrunPrerequisiteResult(global::System.Management.Au /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The represent of missing permissions [System.ComponentModel.TypeConverter(typeof(PermissionsMissingDryrunPrerequisiteResultTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/PermissionsMissingDryrunPrerequisiteResult.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/PermissionsMissingDryrunPrerequisiteResult.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/PermissionsMissingDryrunPrerequisiteResult.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/PermissionsMissingDryrunPrerequisiteResult.TypeConverter.cs index 98d8d8e3b4f4..e7b279af4845 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/PermissionsMissingDryrunPrerequisiteResult.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/PermissionsMissingDryrunPrerequisiteResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPermissionsMissingDryrunPrerequisiteResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPermissionsMissingDryrunPrerequisiteResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPermissionsMissingDryrunPrerequisiteResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPermissionsMissingDryrunPrerequisiteResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/PermissionsMissingDryrunPrerequisiteResult.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/PermissionsMissingDryrunPrerequisiteResult.cs similarity index 80% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/PermissionsMissingDryrunPrerequisiteResult.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/PermissionsMissingDryrunPrerequisiteResult.cs index e881273f0f54..a9461788ea05 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/PermissionsMissingDryrunPrerequisiteResult.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/PermissionsMissingDryrunPrerequisiteResult.cs @@ -3,28 +3,28 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The represent of missing permissions public partial class PermissionsMissingDryrunPrerequisiteResult : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPermissionsMissingDryrunPrerequisiteResult, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPermissionsMissingDryrunPrerequisiteResultInternal, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPermissionsMissingDryrunPrerequisiteResult, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPermissionsMissingDryrunPrerequisiteResultInternal, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult __dryrunPrerequisiteResult = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunPrerequisiteResult(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResult __dryrunPrerequisiteResult = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunPrerequisiteResult(); /// Backing field for property. - private string[] _permission; + private System.Collections.Generic.List _permission; /// The permission list [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public string[] Permission { get => this._permission; set => this._permission = value; } + public System.Collections.Generic.List Permission { get => this._permission; set => this._permission = value; } /// Backing field for property. private string _recommendedRole; @@ -41,15 +41,16 @@ public partial class PermissionsMissingDryrunPrerequisiteResult : public string Scope { get => this._scope; set => this._scope = value; } /// The type of dryrun result. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Constant] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPrerequisiteResultType Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResultInternal)__dryrunPrerequisiteResult).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResultInternal)__dryrunPrerequisiteResult).Type = value ; } + public string Type { get => "permissionsMissing"; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResultInternal)__dryrunPrerequisiteResult).Type = "permissionsMissing"; } /// /// Creates an new instance. /// public PermissionsMissingDryrunPrerequisiteResult() { - + this.__dryrunPrerequisiteResult.Type = "permissionsMissing"; } /// Validates that this object meets the validation criteria. @@ -67,20 +68,26 @@ public PermissionsMissingDryrunPrerequisiteResult() /// The represent of missing permissions public partial interface IPermissionsMissingDryrunPrerequisiteResult : Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResult + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResult { /// The permission list [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The permission list", SerializedName = @"permissions", PossibleTypes = new [] { typeof(string) })] - string[] Permission { get; set; } + System.Collections.Generic.List Permission { get; set; } /// The recommended role to resolve permissions missing [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The recommended role to resolve permissions missing", SerializedName = @"recommendedRole", PossibleTypes = new [] { typeof(string) })] @@ -89,6 +96,9 @@ public partial interface IPermissionsMissingDryrunPrerequisiteResult : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The permission scope", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -97,10 +107,10 @@ public partial interface IPermissionsMissingDryrunPrerequisiteResult : } /// The represent of missing permissions internal partial interface IPermissionsMissingDryrunPrerequisiteResultInternal : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPrerequisiteResultInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPrerequisiteResultInternal { /// The permission list - string[] Permission { get; set; } + System.Collections.Generic.List Permission { get; set; } /// The recommended role to resolve permissions missing string RecommendedRole { get; set; } /// The permission scope diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/PermissionsMissingDryrunPrerequisiteResult.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/PermissionsMissingDryrunPrerequisiteResult.json.cs similarity index 90% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/PermissionsMissingDryrunPrerequisiteResult.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/PermissionsMissingDryrunPrerequisiteResult.json.cs index 6e8724b65529..d4973e000a1e 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/PermissionsMissingDryrunPrerequisiteResult.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/PermissionsMissingDryrunPrerequisiteResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PermissionsMissingDryrunPrerequisiteResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPermissionsMissingDryrunPrerequisiteResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPermissionsMissingDryrunPrerequisiteResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPermissionsMissingDryrunPrerequisiteResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPermissionsMissingDryrunPrerequisiteResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPermissionsMissingDryrunPrerequisiteResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPermissionsMissingDryrunPrerequisiteResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new PermissionsMissingDryrunPrerequisiteResult(json) : null; } @@ -77,10 +77,10 @@ internal PermissionsMissingDryrunPrerequisiteResult(Microsoft.Azure.PowerShell.C { return; } - __dryrunPrerequisiteResult = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunPrerequisiteResult(json); - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} - {_permission = If( json?.PropertyT("permissions"), out var __jsonPermissions) ? If( __jsonPermissions as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Permission;} - {_recommendedRole = If( json?.PropertyT("recommendedRole"), out var __jsonRecommendedRole) ? (string)__jsonRecommendedRole : (string)RecommendedRole;} + __dryrunPrerequisiteResult = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunPrerequisiteResult(json); + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} + {_permission = If( json?.PropertyT("permissions"), out var __jsonPermissions) ? If( __jsonPermissions as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _permission;} + {_recommendedRole = If( json?.PropertyT("recommendedRole"), out var __jsonRecommendedRole) ? (string)__jsonRecommendedRole : (string)_recommendedRole;} AfterFromJson(json); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ProxyResource.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ProxyResource.PowerShell.cs similarity index 58% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ProxyResource.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ProxyResource.PowerShell.cs index 0f4484d9e5bf..cea598a42365 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ProxyResource.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ProxyResource.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -57,27 +57,35 @@ public partial class ProxyResource partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IProxyResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IProxyResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ProxyResource(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IProxyResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IProxyResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ProxyResource(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IPro /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IProxyResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IProxyResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,49 +113,49 @@ internal ProxyResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("SystemDataCreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("SystemDataCreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("SystemData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.SystemDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SystemDataTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -162,43 +170,43 @@ internal ProxyResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("SystemDataCreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("SystemDataCreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("SystemData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.SystemDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SystemDataTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -207,6 +215,18 @@ internal ProxyResource(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location [System.ComponentModel.TypeConverter(typeof(ProxyResourceTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ProxyResource.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ProxyResource.TypeConverter.cs similarity index 98% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ProxyResource.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ProxyResource.TypeConverter.cs index 646ad0e05d40..820d70a2840d 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ProxyResource.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ProxyResource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IProxyResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IProxyResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IProxyResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IProxyResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ProxyResource.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ProxyResource.cs similarity index 52% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ProxyResource.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ProxyResource.cs index 2d12969a03d5..3260e43fbe68 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ProxyResource.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ProxyResource.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -11,73 +11,90 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 /// 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.ServiceLinker.Models.Api30.IProxyResource, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IProxyResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IProxyResource, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IProxyResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Resource(); /// /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).Id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).Name = value ?? null; } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemData = value; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).SystemDataLastModifiedByType = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).Type = value ?? null; } /// The name of the resource [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).Name; } /// /// Azure Resource Manager metadata containing createdBy and modifiedBy information. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemData; } + internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).SystemData = value ?? null /* model class */; } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).SystemDataCreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataCreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).SystemDataCreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).SystemDataCreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).SystemDataLastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataLastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).SystemDataLastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)__resource).Type; } /// Creates an new instance. public ProxyResource() @@ -100,13 +117,13 @@ public ProxyResource() /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location public partial interface IProxyResource : Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResource + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResource { } /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location internal partial interface IProxyResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal { } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ProxyResource.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ProxyResource.json.cs similarity index 95% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ProxyResource.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ProxyResource.json.cs index 3057ac37d5e5..b3e9c3d304bd 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/ProxyResource.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ProxyResource.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class ProxyResource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IProxyResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IProxyResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IProxyResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IProxyResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IProxyResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IProxyResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new ProxyResource(json) : null; } @@ -79,7 +79,7 @@ internal ProxyResource(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime. { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.Resource(json); + __resource = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Resource(json); AfterFromJson(json); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/PublicNetworkSolution.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/PublicNetworkSolution.PowerShell.cs similarity index 58% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/PublicNetworkSolution.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/PublicNetworkSolution.PowerShell.cs index 31e2ed8a0030..f78cdcd525d6 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/PublicNetworkSolution.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/PublicNetworkSolution.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class PublicNetworkSolution partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolution DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PublicNetworkSolution(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolution DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PublicNetworkSolution(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolution FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,33 +111,33 @@ internal PublicNetworkSolution(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("FirewallRule")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)this).FirewallRule = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules) content.GetValueForProperty("FirewallRule",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)this).FirewallRule, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.FirewallRulesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)this).FirewallRule = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules) content.GetValueForProperty("FirewallRule",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)this).FirewallRule, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.FirewallRulesTypeConverter.ConvertFrom); } if (content.Contains("DeleteOrUpdateBehavior")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)this).DeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)this).DeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)this).DeleteOrUpdateBehavior = (string) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)this).DeleteOrUpdateBehavior, global::System.Convert.ToString); } if (content.Contains("Action")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType?) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)this).Action = (string) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)this).Action, global::System.Convert.ToString); } if (content.Contains("FirewallRuleIPRange")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)this).FirewallRuleIPRange = (string[]) content.GetValueForProperty("FirewallRuleIPRange",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)this).FirewallRuleIPRange, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)this).FirewallRuleIPRange = (System.Collections.Generic.List) content.GetValueForProperty("FirewallRuleIPRange",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)this).FirewallRuleIPRange, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("FirewallRuleAzureService")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)this).FirewallRuleAzureService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType?) content.GetValueForProperty("FirewallRuleAzureService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)this).FirewallRuleAzureService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)this).FirewallRuleAzureService = (string) content.GetValueForProperty("FirewallRuleAzureService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)this).FirewallRuleAzureService, global::System.Convert.ToString); } if (content.Contains("FirewallRuleCallerClientIP")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)this).FirewallRuleCallerClientIP = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType?) content.GetValueForProperty("FirewallRuleCallerClientIP",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)this).FirewallRuleCallerClientIP, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)this).FirewallRuleCallerClientIP = (string) content.GetValueForProperty("FirewallRuleCallerClientIP",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)this).FirewallRuleCallerClientIP, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -146,27 +152,27 @@ internal PublicNetworkSolution(global::System.Management.Automation.PSObject con // actually deserialize if (content.Contains("FirewallRule")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)this).FirewallRule = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules) content.GetValueForProperty("FirewallRule",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)this).FirewallRule, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.FirewallRulesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)this).FirewallRule = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules) content.GetValueForProperty("FirewallRule",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)this).FirewallRule, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.FirewallRulesTypeConverter.ConvertFrom); } if (content.Contains("DeleteOrUpdateBehavior")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)this).DeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)this).DeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)this).DeleteOrUpdateBehavior = (string) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)this).DeleteOrUpdateBehavior, global::System.Convert.ToString); } if (content.Contains("Action")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType?) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)this).Action = (string) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)this).Action, global::System.Convert.ToString); } if (content.Contains("FirewallRuleIPRange")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)this).FirewallRuleIPRange = (string[]) content.GetValueForProperty("FirewallRuleIPRange",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)this).FirewallRuleIPRange, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)this).FirewallRuleIPRange = (System.Collections.Generic.List) content.GetValueForProperty("FirewallRuleIPRange",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)this).FirewallRuleIPRange, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("FirewallRuleAzureService")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)this).FirewallRuleAzureService = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType?) content.GetValueForProperty("FirewallRuleAzureService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)this).FirewallRuleAzureService, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)this).FirewallRuleAzureService = (string) content.GetValueForProperty("FirewallRuleAzureService",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)this).FirewallRuleAzureService, global::System.Convert.ToString); } if (content.Contains("FirewallRuleCallerClientIP")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)this).FirewallRuleCallerClientIP = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType?) content.GetValueForProperty("FirewallRuleCallerClientIP",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal)this).FirewallRuleCallerClientIP, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)this).FirewallRuleCallerClientIP = (string) content.GetValueForProperty("FirewallRuleCallerClientIP",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal)this).FirewallRuleCallerClientIP, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -175,6 +181,18 @@ internal PublicNetworkSolution(global::System.Management.Automation.PSObject con /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Indicates public network solution, include firewall rules [System.ComponentModel.TypeConverter(typeof(PublicNetworkSolutionTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/PublicNetworkSolution.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/PublicNetworkSolution.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/PublicNetworkSolution.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/PublicNetworkSolution.TypeConverter.cs index a283bbf8db96..274e309bee81 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/PublicNetworkSolution.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/PublicNetworkSolution.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolution ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolution).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/PublicNetworkSolution.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/PublicNetworkSolution.cs similarity index 64% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/PublicNetworkSolution.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/PublicNetworkSolution.cs index 2cc0127e55c6..60ae2f8a71fc 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/PublicNetworkSolution.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/PublicNetworkSolution.cs @@ -3,64 +3,64 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// Indicates public network solution, include firewall rules public partial class PublicNetworkSolution : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolution, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? _action; + private string _action; /// /// Optional. Indicates public network solution. If enable, enable public network access of target service with best try. /// Default is enable. If optOut, opt out public network access configuration. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? Action { get => this._action; set => this._action = value; } + public string Action { get => this._action; set => this._action = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? _deleteOrUpdateBehavior; + private string _deleteOrUpdateBehavior; /// /// Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get => this._deleteOrUpdateBehavior; set => this._deleteOrUpdateBehavior = value; } + public string DeleteOrUpdateBehavior { get => this._deleteOrUpdateBehavior; set => this._deleteOrUpdateBehavior = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules _firewallRule; + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules _firewallRule; /// /// Describe firewall rules of target service to make sure source application could connect to the target. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules FirewallRule { get => (this._firewallRule = this._firewallRule ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.FirewallRules()); set => this._firewallRule = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules FirewallRule { get => (this._firewallRule = this._firewallRule ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.FirewallRules()); set => this._firewallRule = value; } /// Allow Azure services to access the target service if true. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? FirewallRuleAzureService { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRulesInternal)FirewallRule).AzureService; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRulesInternal)FirewallRule).AzureService = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType)""); } + public string FirewallRuleAzureService { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRulesInternal)FirewallRule).AzureService; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRulesInternal)FirewallRule).AzureService = value ?? null; } /// /// Allow caller client IP to access the target service if true. the property is used when connecting local application to /// target service. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? FirewallRuleCallerClientIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRulesInternal)FirewallRule).CallerClientIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRulesInternal)FirewallRule).CallerClientIP = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType)""); } + public string FirewallRuleCallerClientIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRulesInternal)FirewallRule).CallerClientIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRulesInternal)FirewallRule).CallerClientIP = value ?? null; } /// /// This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client /// IPs for a given database account. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string[] FirewallRuleIPRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRulesInternal)FirewallRule).IPRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRulesInternal)FirewallRule).IPRange = value ?? null /* arrayOf */; } + public System.Collections.Generic.List FirewallRuleIPRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRulesInternal)FirewallRule).IPRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRulesInternal)FirewallRule).IPRange = value ?? null /* arrayOf */; } /// Internal Acessors for FirewallRule - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolutionInternal.FirewallRule { get => (this._firewallRule = this._firewallRule ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.FirewallRules()); set { {_firewallRule = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolutionInternal.FirewallRule { get => (this._firewallRule = this._firewallRule ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.FirewallRules()); set { {_firewallRule = value;} } } /// Creates an new instance. public PublicNetworkSolution() @@ -79,28 +79,40 @@ public partial interface IPublicNetworkSolution : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Optional. Indicates public network solution. If enable, enable public network access of target service with best try. Default is enable. If optOut, opt out public network access configuration.", SerializedName = @"action", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? Action { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + string Action { get; set; } /// /// Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string DeleteOrUpdateBehavior { get; set; } /// Allow Azure services to access the target service if true. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Allow Azure services to access the target service if true.", SerializedName = @"azureServices", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? FirewallRuleAzureService { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + string FirewallRuleAzureService { get; set; } /// /// Allow caller client IP to access the target service if true. the property is used when connecting local application to /// target service. @@ -108,10 +120,14 @@ public partial interface IPublicNetworkSolution : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Allow caller client IP to access the target service if true. the property is used when connecting local application to target service.", SerializedName = @"callerClientIP", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? FirewallRuleCallerClientIP { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + string FirewallRuleCallerClientIP { get; set; } /// /// This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client /// IPs for a given database account. @@ -119,10 +135,13 @@ public partial interface IPublicNetworkSolution : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account.", SerializedName = @"ipRanges", PossibleTypes = new [] { typeof(string) })] - string[] FirewallRuleIPRange { get; set; } + System.Collections.Generic.List FirewallRuleIPRange { get; set; } } /// Indicates public network solution, include firewall rules @@ -133,27 +152,31 @@ internal partial interface IPublicNetworkSolutionInternal /// Optional. Indicates public network solution. If enable, enable public network access of target service with best try. /// Default is enable. If optOut, opt out public network access configuration. /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType? Action { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + string Action { get; set; } /// /// Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string DeleteOrUpdateBehavior { get; set; } /// /// Describe firewall rules of target service to make sure source application could connect to the target. /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IFirewallRules FirewallRule { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IFirewallRules FirewallRule { get; set; } /// Allow Azure services to access the target service if true. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? FirewallRuleAzureService { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + string FirewallRuleAzureService { get; set; } /// /// Allow caller client IP to access the target service if true. the property is used when connecting local application to /// target service. /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType? FirewallRuleCallerClientIP { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + string FirewallRuleCallerClientIP { get; set; } /// /// This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client /// IPs for a given database account. /// - string[] FirewallRuleIPRange { get; set; } + System.Collections.Generic.List FirewallRuleIPRange { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/PublicNetworkSolution.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/PublicNetworkSolution.json.cs similarity index 92% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/PublicNetworkSolution.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/PublicNetworkSolution.json.cs index d94a07d245dc..2187a9ba009d 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/PublicNetworkSolution.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/PublicNetworkSolution.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PublicNetworkSolution partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolution. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolution. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IPublicNetworkSolution FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IPublicNetworkSolution FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new PublicNetworkSolution(json) : null; } @@ -77,9 +77,9 @@ internal PublicNetworkSolution(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker. { return; } - {_firewallRule = If( json?.PropertyT("firewallRules"), out var __jsonFirewallRules) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.FirewallRules.FromJson(__jsonFirewallRules) : FirewallRule;} - {_deleteOrUpdateBehavior = If( json?.PropertyT("deleteOrUpdateBehavior"), out var __jsonDeleteOrUpdateBehavior) ? (string)__jsonDeleteOrUpdateBehavior : (string)DeleteOrUpdateBehavior;} - {_action = If( json?.PropertyT("action"), out var __jsonAction) ? (string)__jsonAction : (string)Action;} + {_firewallRule = If( json?.PropertyT("firewallRules"), out var __jsonFirewallRules) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.FirewallRules.FromJson(__jsonFirewallRules) : _firewallRule;} + {_deleteOrUpdateBehavior = If( json?.PropertyT("deleteOrUpdateBehavior"), out var __jsonDeleteOrUpdateBehavior) ? (string)__jsonDeleteOrUpdateBehavior : (string)_deleteOrUpdateBehavior;} + {_action = If( json?.PropertyT("action"), out var __jsonAction) ? (string)__jsonAction : (string)_action;} AfterFromJson(json); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/Resource.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Resource.PowerShell.cs similarity index 57% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/Resource.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Resource.PowerShell.cs index 2d59e04bb9ec..f6369cadee9e 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/Resource.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Resource.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -57,27 +57,35 @@ public partial class Resource partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Resource(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Resource(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IRes /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,49 +113,49 @@ internal Resource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("SystemData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.SystemDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SystemDataTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("SystemDataCreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -162,43 +170,43 @@ internal Resource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("SystemData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.SystemDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SystemDataTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("SystemDataCreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializePSObject(content); } @@ -207,6 +215,18 @@ internal Resource(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Common fields that are returned in the response for all Azure Resource Manager resources [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/Resource.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Resource.TypeConverter.cs similarity index 98% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/Resource.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Resource.TypeConverter.cs index 36137338c55c..016231cace21 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/Resource.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Resource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/Resource.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Resource.cs similarity index 63% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/Resource.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Resource.cs index bb9a2a0574b3..8f56ddeb88e6 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/Resource.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Resource.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 /// Common fields that are returned in the response for all Azure Resource Manager resources /// public partial class Resource : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResource, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResource, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal { /// Backing field for property. @@ -25,16 +25,34 @@ public partial class Resource : public string Id { get => this._id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.SystemData()); set { {_systemData = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)SystemData).CreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)SystemData).LastModifiedByType = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResourceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -44,37 +62,37 @@ public partial class Resource : public string Name { get => this._name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData _systemData; /// /// Azure Resource Manager metadata containing createdBy and modifiedBy information. /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// Backing field for property. private string _type; @@ -101,6 +119,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -109,6 +130,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the resource", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -116,57 +140,80 @@ public partial interface IResource : /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource creation (UTC).", SerializedName = @"createdAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataCreatedAt { get; set; } + global::System.DateTime? SystemDataCreatedAt { get; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that created the resource.", SerializedName = @"createdBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataCreatedBy { get; set; } + string SystemDataCreatedBy { get; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that created the resource.", SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource last modification (UTC)", SerializedName = @"lastModifiedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataLastModifiedAt { get; set; } + global::System.DateTime? SystemDataLastModifiedAt { get; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that last modified the resource.", SerializedName = @"lastModifiedBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataLastModifiedBy { get; set; } + string SystemDataLastModifiedBy { get; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that last modified the resource.", SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of the resource. E.g. ""Microsoft.Compute/virtualMachines"" or ""Microsoft.Storage/storageAccounts""", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -186,19 +233,21 @@ internal partial interface IResourceInternal /// /// Azure Resource Manager metadata containing createdBy and modifiedBy information. /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData SystemData { get; set; } /// The timestamp of resource creation (UTC). global::System.DateTime? SystemDataCreatedAt { get; set; } /// The identity that created the resource. string SystemDataCreatedBy { get; set; } /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; set; } /// The timestamp of resource last modification (UTC) global::System.DateTime? SystemDataLastModifiedAt { get; set; } /// The identity that last modified the resource. string SystemDataLastModifiedBy { get; set; } /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/Resource.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Resource.json.cs similarity index 94% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/Resource.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Resource.json.cs index 437c997420f1..7fa79cd6c641 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/Resource.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Resource.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class Resource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new Resource(json) : null; } @@ -79,10 +79,10 @@ internal Resource(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json. { return; } - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.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;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SystemData.FromJson(__jsonSystemData) : _systemData;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } @@ -105,19 +105,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode To { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ResourceList.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ResourceList.PowerShell.cs similarity index 70% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ResourceList.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ResourceList.PowerShell.cs index 25c933f0f265..4f08faf29c91 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ResourceList.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ResourceList.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class ResourceList partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IResourceList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ResourceList(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IResourceList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ResourceList(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IResourceList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,17 +111,17 @@ internal ResourceList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IResourceListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IResourceListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IResourceListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IResourceListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerResourceTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -128,11 +136,11 @@ internal ResourceList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IResourceListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IResourceListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IResourceListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IResourceListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerResourceTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -141,6 +149,18 @@ internal ResourceList(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The list of Linker. [System.ComponentModel.TypeConverter(typeof(ResourceListTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ResourceList.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ResourceList.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ResourceList.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ResourceList.TypeConverter.cs index a803efaa6677..fd5fafa25fa0 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ResourceList.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ResourceList.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IResourceList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IResourceList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ResourceList.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ResourceList.cs similarity index 77% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ResourceList.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ResourceList.cs index eff0870fc3b1..fac772052719 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ResourceList.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ResourceList.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The list of Linker. public partial class ResourceList : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IResourceList, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IResourceListInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceList, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceListInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class ResourceList : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource[] _value; + private System.Collections.Generic.List _value; /// The list of Linkers. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public ResourceList() @@ -41,6 +41,9 @@ public partial interface IResourceList : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Linker used to get the next page of Linker list.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IResourceList : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of Linkers.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource) })] + System.Collections.Generic.List Value { get; set; } } /// The list of Linker. @@ -62,7 +68,7 @@ internal partial interface IResourceListInternal /// The Linker used to get the next page of Linker list. string NextLink { get; set; } /// The list of Linkers. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ResourceList.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ResourceList.json.cs similarity index 90% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ResourceList.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ResourceList.json.cs index 9e2e2a5495d6..a2964bbc426d 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ResourceList.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ResourceList.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ResourceList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IResourceList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IResourceList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IResourceList FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceList FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new ResourceList(json) : null; } @@ -77,8 +77,8 @@ internal ResourceList(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.J { return; } - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Models.Api20221101Preview.ILinkerResource) (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerResource.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource) (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerResource.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretAuthInfo.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretAuthInfo.PowerShell.cs similarity index 70% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretAuthInfo.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretAuthInfo.PowerShell.cs index 6246db7b553e..2c621ad6e4c0 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretAuthInfo.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretAuthInfo.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class SecretAuthInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretAuthInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretAuthInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SecretAuthInfo(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretAuthInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretAuthInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SecretAuthInfo(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretAuthInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretAuthInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,21 +111,21 @@ internal SecretAuthInfo(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretAuthInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretAuthInfoInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretAuthInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretAuthInfoInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("SecretInfo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretAuthInfoInternal)this).SecretInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBase) content.GetValueForProperty("SecretInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretAuthInfoInternal)this).SecretInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretInfoBaseTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretAuthInfoInternal)this).SecretInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBase) content.GetValueForProperty("SecretInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretAuthInfoInternal)this).SecretInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretInfoBaseTypeConverter.ConvertFrom); } if (content.Contains("AuthType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType = (string) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -134,15 +140,15 @@ internal SecretAuthInfo(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretAuthInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretAuthInfoInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretAuthInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretAuthInfoInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("SecretInfo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretAuthInfoInternal)this).SecretInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBase) content.GetValueForProperty("SecretInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretAuthInfoInternal)this).SecretInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretInfoBaseTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretAuthInfoInternal)this).SecretInfo = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBase) content.GetValueForProperty("SecretInfo",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretAuthInfoInternal)this).SecretInfo, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretInfoBaseTypeConverter.ConvertFrom); } if (content.Contains("AuthType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType = (string) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -151,6 +157,18 @@ internal SecretAuthInfo(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The authentication info when authType is secret [System.ComponentModel.TypeConverter(typeof(SecretAuthInfoTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretAuthInfo.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretAuthInfo.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretAuthInfo.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretAuthInfo.TypeConverter.cs index a92bb366ce2d..822066b2dcff 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretAuthInfo.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretAuthInfo.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretAuthInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretAuthInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretAuthInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretAuthInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretAuthInfo.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretAuthInfo.cs similarity index 73% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretAuthInfo.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretAuthInfo.cs index 0b1145adf478..7858df847e56 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretAuthInfo.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretAuthInfo.cs @@ -3,25 +3,25 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The authentication info when authType is secret public partial class SecretAuthInfo : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretAuthInfo, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretAuthInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretAuthInfo, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretAuthInfoInternal, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AuthInfoBase(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AuthInfoBase(); /// The authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Constant] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType AuthType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)__authInfoBase).AuthType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)__authInfoBase).AuthType = value ; } + public string AuthType { get => "secret"; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)__authInfoBase).AuthType = "secret"; } /// Backing field for property. private string _name; @@ -31,16 +31,16 @@ public partial class SecretAuthInfo : public string Name { get => this._name; set => this._name = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBase _secretInfo; + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBase _secretInfo; /// Password or key vault secret for secret auth. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBase SecretInfo { get => (this._secretInfo = this._secretInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretInfoBase()); set => this._secretInfo = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBase SecretInfo { get => (this._secretInfo = this._secretInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretInfoBase()); set => this._secretInfo = value; } /// Creates an new instance. public SecretAuthInfo() { - + this.__authInfoBase.AuthType = "secret"; } /// Validates that this object meets the validation criteria. @@ -58,12 +58,15 @@ public SecretAuthInfo() /// The authentication info when authType is secret public partial interface ISecretAuthInfo : Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase { /// Username or account name for secret auth. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Username or account name for secret auth.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -72,20 +75,23 @@ public partial interface ISecretAuthInfo : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Password or key vault secret for secret auth.", SerializedName = @"secretInfo", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBase),typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValueSecretInfo),typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretReferenceSecretInfo),typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IKeyVaultSecretUriSecretInfo) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBase SecretInfo { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBase),typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValueSecretInfo),typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretReferenceSecretInfo),typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IKeyVaultSecretUriSecretInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBase SecretInfo { get; set; } } /// The authentication info when authType is secret internal partial interface ISecretAuthInfoInternal : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal { /// Username or account name for secret auth. string Name { get; set; } /// Password or key vault secret for secret auth. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBase SecretInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBase SecretInfo { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretAuthInfo.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretAuthInfo.json.cs similarity index 93% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretAuthInfo.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretAuthInfo.json.cs index 16b32f4cd8e6..73a71b308d57 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretAuthInfo.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretAuthInfo.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SecretAuthInfo partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretAuthInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretAuthInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretAuthInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretAuthInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretAuthInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretAuthInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new SecretAuthInfo(json) : null; } @@ -77,9 +77,9 @@ internal SecretAuthInfo(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime { return; } - __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AuthInfoBase(json); - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_secretInfo = If( json?.PropertyT("secretInfo"), out var __jsonSecretInfo) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretInfoBase.FromJson(__jsonSecretInfo) : SecretInfo;} + __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AuthInfoBase(json); + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_secretInfo = If( json?.PropertyT("secretInfo"), out var __jsonSecretInfo) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretInfoBase.FromJson(__jsonSecretInfo) : _secretInfo;} AfterFromJson(json); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretInfoBase.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretInfoBase.PowerShell.cs similarity index 77% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretInfoBase.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretInfoBase.PowerShell.cs index 319e4c9f469c..e91a1ee7efde 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretInfoBase.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretInfoBase.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class SecretInfoBase partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBase DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBase DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SecretInfoBase(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBase DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBase DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SecretInfoBase(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBase FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBase FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,13 +111,13 @@ internal SecretInfoBase(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("SecretType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBaseInternal)this).SecretType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType) content.GetValueForProperty("SecretType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBaseInternal)this).SecretType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBaseInternal)this).SecretType = (string) content.GetValueForProperty("SecretType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBaseInternal)this).SecretType, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -126,7 +132,7 @@ internal SecretInfoBase(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("SecretType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBaseInternal)this).SecretType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType) content.GetValueForProperty("SecretType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBaseInternal)this).SecretType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBaseInternal)this).SecretType = (string) content.GetValueForProperty("SecretType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBaseInternal)this).SecretType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -135,6 +141,18 @@ internal SecretInfoBase(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The secret info [System.ComponentModel.TypeConverter(typeof(SecretInfoBaseTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretInfoBase.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretInfoBase.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretInfoBase.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretInfoBase.TypeConverter.cs index a46fcb90009a..5e71f28f270f 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretInfoBase.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretInfoBase.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBase ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBase ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBase).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBase).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretInfoBase.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretInfoBase.cs similarity index 70% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretInfoBase.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretInfoBase.cs index 418da5340298..c2a5e4c740a1 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretInfoBase.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretInfoBase.cs @@ -3,22 +3,22 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The secret info public partial class SecretInfoBase : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBase, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBaseInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBase, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBaseInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType _secretType; + private string _secretType; /// The secret type. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType SecretType { get => this._secretType; set => this._secretType = value; } + public string SecretType { get => this._secretType; set => this._secretType = value; } /// Creates an new instance. public SecretInfoBase() @@ -34,10 +34,14 @@ public partial interface ISecretInfoBase : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The secret type.", SerializedName = @"secretType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType SecretType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("rawValue", "keyVaultSecretUri", "keyVaultSecretReference")] + string SecretType { get; set; } } /// The secret info @@ -45,7 +49,8 @@ internal partial interface ISecretInfoBaseInternal { /// The secret type. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType SecretType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("rawValue", "keyVaultSecretUri", "keyVaultSecretReference")] + string SecretType { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretInfoBase.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretInfoBase.json.cs similarity index 93% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretInfoBase.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretInfoBase.json.cs index ffc8ddb9d301..1853c10f7ae3 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretInfoBase.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretInfoBase.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -54,15 +54,15 @@ public partial class SecretInfoBase partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBase. - /// Note: the Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBase interface is polymorphic, - /// and the precise model class that will get deserialized is determined at runtime based on the payload. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBase. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBase interface is polymorphic, and the precise + /// model class that will get deserialized is determined at runtime based on the payload. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBase. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBase. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBase FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBase FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { if (!(node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json)) { @@ -100,7 +100,7 @@ internal SecretInfoBase(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime { return; } - {_secretType = If( json?.PropertyT("secretType"), out var __jsonSecretType) ? (string)__jsonSecretType : (string)SecretType;} + {_secretType = If( json?.PropertyT("secretType"), out var __jsonSecretType) ? (string)__jsonSecretType : (string)_secretType;} AfterFromJson(json); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretStore.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretStore.PowerShell.cs similarity index 74% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretStore.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretStore.PowerShell.cs index 4cd0b645e466..349e1d3bc675 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretStore.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretStore.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class SecretStore partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStore DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SecretStore(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStore DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SecretStore(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStore FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,17 +111,17 @@ internal SecretStore(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("KeyVaultId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStoreInternal)this).KeyVaultId = (string) content.GetValueForProperty("KeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStoreInternal)this).KeyVaultId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStoreInternal)this).KeyVaultId = (string) content.GetValueForProperty("KeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStoreInternal)this).KeyVaultId, global::System.Convert.ToString); } if (content.Contains("KeyVaultSecretName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStoreInternal)this).KeyVaultSecretName = (string) content.GetValueForProperty("KeyVaultSecretName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStoreInternal)this).KeyVaultSecretName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStoreInternal)this).KeyVaultSecretName = (string) content.GetValueForProperty("KeyVaultSecretName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStoreInternal)this).KeyVaultSecretName, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -128,11 +136,11 @@ internal SecretStore(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("KeyVaultId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStoreInternal)this).KeyVaultId = (string) content.GetValueForProperty("KeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStoreInternal)this).KeyVaultId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStoreInternal)this).KeyVaultId = (string) content.GetValueForProperty("KeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStoreInternal)this).KeyVaultId, global::System.Convert.ToString); } if (content.Contains("KeyVaultSecretName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStoreInternal)this).KeyVaultSecretName = (string) content.GetValueForProperty("KeyVaultSecretName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStoreInternal)this).KeyVaultSecretName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStoreInternal)this).KeyVaultSecretName = (string) content.GetValueForProperty("KeyVaultSecretName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStoreInternal)this).KeyVaultSecretName, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -141,6 +149,18 @@ internal SecretStore(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// An option to store secret value in secure place [System.ComponentModel.TypeConverter(typeof(SecretStoreTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretStore.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretStore.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretStore.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretStore.TypeConverter.cs index bf6e128b000f..e0176bb69869 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretStore.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretStore.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStore ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStore).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretStore.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretStore.cs similarity index 94% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretStore.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretStore.cs index 9e4908efb48b..0b35208f8d6e 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretStore.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretStore.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// An option to store secret value in secure place public partial class SecretStore : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStore, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStoreInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStoreInternal { /// Backing field for property. @@ -41,6 +41,9 @@ public partial interface ISecretStore : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The key vault id to store secret", SerializedName = @"keyVaultId", PossibleTypes = new [] { typeof(string) })] @@ -49,6 +52,9 @@ public partial interface ISecretStore : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The key vault secret name to store secret, only valid when storing one secret", SerializedName = @"keyVaultSecretName", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretStore.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretStore.json.cs similarity index 95% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretStore.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretStore.json.cs index 6bec08d41755..b6a94ba51d1e 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SecretStore.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SecretStore.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SecretStore partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStore. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStore. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretStore FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretStore FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new SecretStore(json) : null; } @@ -77,8 +77,8 @@ internal SecretStore(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Js { return; } - {_keyVaultId = If( json?.PropertyT("keyVaultId"), out var __jsonKeyVaultId) ? (string)__jsonKeyVaultId : (string)KeyVaultId;} - {_keyVaultSecretName = If( json?.PropertyT("keyVaultSecretName"), out var __jsonKeyVaultSecretName) ? (string)__jsonKeyVaultSecretName : (string)KeyVaultSecretName;} + {_keyVaultId = If( json?.PropertyT("keyVaultId"), out var __jsonKeyVaultId) ? (string)__jsonKeyVaultId : (string)_keyVaultId;} + {_keyVaultSecretName = If( json?.PropertyT("keyVaultSecretName"), out var __jsonKeyVaultSecretName) ? (string)__jsonKeyVaultSecretName : (string)_keyVaultSecretName;} AfterFromJson(json); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SelfHostedServer.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SelfHostedServer.PowerShell.cs similarity index 74% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SelfHostedServer.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SelfHostedServer.PowerShell.cs index 1ec63404a249..6158c062f63d 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SelfHostedServer.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SelfHostedServer.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class SelfHostedServer partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISelfHostedServer DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISelfHostedServer DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SelfHostedServer(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISelfHostedServer DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISelfHostedServer DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SelfHostedServer(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISelfHostedServer FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISelfHostedServer FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,17 +111,17 @@ internal SelfHostedServer(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Endpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISelfHostedServerInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISelfHostedServerInternal)this).Endpoint, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISelfHostedServerInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISelfHostedServerInternal)this).Endpoint, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal)this).Type, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -130,11 +136,11 @@ internal SelfHostedServer(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Endpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISelfHostedServerInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISelfHostedServerInternal)this).Endpoint, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISelfHostedServerInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISelfHostedServerInternal)this).Endpoint, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -143,6 +149,18 @@ internal SelfHostedServer(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The service properties when target service type is SelfHostedServer [System.ComponentModel.TypeConverter(typeof(SelfHostedServerTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SelfHostedServer.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SelfHostedServer.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SelfHostedServer.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SelfHostedServer.TypeConverter.cs index 084a5b7c8c1f..0db606290b43 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SelfHostedServer.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SelfHostedServer.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISelfHostedServer ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISelfHostedServer ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISelfHostedServer).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISelfHostedServer).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SelfHostedServer.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SelfHostedServer.cs similarity index 80% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SelfHostedServer.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SelfHostedServer.cs index 0256bcbc3246..5e1da5aff7db 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SelfHostedServer.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SelfHostedServer.cs @@ -3,21 +3,21 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The service properties when target service type is SelfHostedServer public partial class SelfHostedServer : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISelfHostedServer, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISelfHostedServerInternal, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISelfHostedServer, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISelfHostedServerInternal, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase __targetServiceBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.TargetServiceBase(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase __targetServiceBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.TargetServiceBase(); /// Backing field for property. private string _endpoint; @@ -27,13 +27,14 @@ public partial class SelfHostedServer : public string Endpoint { get => this._endpoint; set => this._endpoint = value; } /// The target service type. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Constant] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)__targetServiceBase).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)__targetServiceBase).Type = value ; } + public string Type { get => "SelfHostedServer"; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal)__targetServiceBase).Type = "SelfHostedServer"; } /// Creates an new instance. public SelfHostedServer() { - + this.__targetServiceBase.Type = "SelfHostedServer"; } /// Validates that this object meets the validation criteria. @@ -51,12 +52,15 @@ public SelfHostedServer() /// The service properties when target service type is SelfHostedServer public partial interface ISelfHostedServer : Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase { /// The endpoint of service. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The endpoint of service.", SerializedName = @"endpoint", PossibleTypes = new [] { typeof(string) })] @@ -65,7 +69,7 @@ public partial interface ISelfHostedServer : } /// The service properties when target service type is SelfHostedServer internal partial interface ISelfHostedServerInternal : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal { /// The endpoint of service. string Endpoint { get; set; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SelfHostedServer.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SelfHostedServer.json.cs similarity index 93% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SelfHostedServer.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SelfHostedServer.json.cs index e50845ae655d..9539e099ba2d 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SelfHostedServer.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SelfHostedServer.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SelfHostedServer partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISelfHostedServer. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISelfHostedServer. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISelfHostedServer. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISelfHostedServer. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISelfHostedServer FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISelfHostedServer FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new SelfHostedServer(json) : null; } @@ -77,8 +77,8 @@ internal SelfHostedServer(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runti { return; } - __targetServiceBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.TargetServiceBase(json); - {_endpoint = If( json?.PropertyT("endpoint"), out var __jsonEndpoint) ? (string)__jsonEndpoint : (string)Endpoint;} + __targetServiceBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.TargetServiceBase(json); + {_endpoint = If( json?.PropertyT("endpoint"), out var __jsonEndpoint) ? (string)__jsonEndpoint : (string)_endpoint;} AfterFromJson(json); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServiceLinkerIdentity.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServiceLinkerIdentity.PowerShell.cs index e476e55f7989..8eb20bd477db 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServiceLinkerIdentity.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServiceLinkerIdentity.PowerShell.cs @@ -53,6 +53,14 @@ public partial class ServiceLinkerIdentity partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + /// /// Deserializes a into an instance of . @@ -188,6 +196,18 @@ internal ServiceLinkerIdentity(global::System.Management.Automation.PSObject con /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } [System.ComponentModel.TypeConverter(typeof(ServiceLinkerIdentityTypeConverter))] public partial interface IServiceLinkerIdentity diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServiceLinkerIdentity.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServiceLinkerIdentity.cs index 3b300f19461e..51dda2915418 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServiceLinkerIdentity.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServiceLinkerIdentity.cs @@ -83,6 +83,9 @@ public partial interface IServiceLinkerIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of resource.", SerializedName = @"connectorName", PossibleTypes = new [] { typeof(string) })] @@ -91,6 +94,9 @@ public partial interface IServiceLinkerIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of dryrun.", SerializedName = @"dryrunName", PossibleTypes = new [] { typeof(string) })] @@ -99,6 +105,9 @@ public partial interface IServiceLinkerIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource identity path", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -107,6 +116,9 @@ public partial interface IServiceLinkerIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name Linker resource.", SerializedName = @"linkerName", PossibleTypes = new [] { typeof(string) })] @@ -115,6 +127,9 @@ public partial interface IServiceLinkerIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of Azure region.", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -123,6 +138,9 @@ public partial interface IServiceLinkerIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the resource group. The name is case insensitive.", SerializedName = @"resourceGroupName", PossibleTypes = new [] { typeof(string) })] @@ -133,6 +151,9 @@ public partial interface IServiceLinkerIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The fully qualified Azure Resource manager identifier of the resource to be connected.", SerializedName = @"resourceUri", PossibleTypes = new [] { typeof(string) })] @@ -141,6 +162,9 @@ public partial interface IServiceLinkerIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The ID of the target subscription.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServiceLinkerIdentity.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServiceLinkerIdentity.json.cs index 9fe970417783..159c7aeb5900 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServiceLinkerIdentity.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServiceLinkerIdentity.json.cs @@ -76,14 +76,14 @@ internal ServiceLinkerIdentity(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker. { return; } - {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} - {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName;} - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} - {_dryrunName = If( json?.PropertyT("dryrunName"), out var __jsonDryrunName) ? (string)__jsonDryrunName : (string)DryrunName;} - {_connectorName = If( json?.PropertyT("connectorName"), out var __jsonConnectorName) ? (string)__jsonConnectorName : (string)ConnectorName;} - {_resourceUri = If( json?.PropertyT("resourceUri"), out var __jsonResourceUri) ? (string)__jsonResourceUri : (string)ResourceUri;} - {_linkerName = If( json?.PropertyT("linkerName"), out var __jsonLinkerName) ? (string)__jsonLinkerName : (string)LinkerName;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)_subscriptionId;} + {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)_resourceGroupName;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} + {_dryrunName = If( json?.PropertyT("dryrunName"), out var __jsonDryrunName) ? (string)__jsonDryrunName : (string)_dryrunName;} + {_connectorName = If( json?.PropertyT("connectorName"), out var __jsonConnectorName) ? (string)__jsonConnectorName : (string)_connectorName;} + {_resourceUri = If( json?.PropertyT("resourceUri"), out var __jsonResourceUri) ? (string)__jsonResourceUri : (string)_resourceUri;} + {_linkerName = If( json?.PropertyT("linkerName"), out var __jsonLinkerName) ? (string)__jsonLinkerName : (string)_linkerName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ServicePrincipalCertificateAuthInfo.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServicePrincipalCertificateAuthInfo.PowerShell.cs similarity index 62% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ServicePrincipalCertificateAuthInfo.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServicePrincipalCertificateAuthInfo.PowerShell.cs index 662e55e09bb0..54a00ae0e76c 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ServicePrincipalCertificateAuthInfo.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServicePrincipalCertificateAuthInfo.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class ServicePrincipalCertificateAuthInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ServicePrincipalCertificateAuthInfo(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ServicePrincipalCertificateAuthInfo(content); } @@ -89,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -107,33 +115,33 @@ internal ServicePrincipalCertificateAuthInfo(global::System.Collections.IDiction // actually deserialize if (content.Contains("ClientId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfoInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfoInternal)this).ClientId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfoInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfoInternal)this).ClientId, global::System.Convert.ToString); } if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfoInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfoInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfoInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfoInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("Certificate")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfoInternal)this).Certificate = (string) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfoInternal)this).Certificate, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfoInternal)this).Certificate = (string) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfoInternal)this).Certificate, global::System.Convert.ToString); } if (content.Contains("DeleteOrUpdateBehavior")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfoInternal)this).DeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfoInternal)this).DeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfoInternal)this).DeleteOrUpdateBehavior = (string) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfoInternal)this).DeleteOrUpdateBehavior, global::System.Convert.ToString); } if (content.Contains("Role")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfoInternal)this).Role = (string[]) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfoInternal)this).Role, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfoInternal)this).Role = (System.Collections.Generic.List) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfoInternal)this).Role, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("AuthType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType = (string) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -148,27 +156,27 @@ internal ServicePrincipalCertificateAuthInfo(global::System.Management.Automatio // actually deserialize if (content.Contains("ClientId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfoInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfoInternal)this).ClientId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfoInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfoInternal)this).ClientId, global::System.Convert.ToString); } if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfoInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfoInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfoInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfoInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("Certificate")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfoInternal)this).Certificate = (string) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfoInternal)this).Certificate, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfoInternal)this).Certificate = (string) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfoInternal)this).Certificate, global::System.Convert.ToString); } if (content.Contains("DeleteOrUpdateBehavior")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfoInternal)this).DeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfoInternal)this).DeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfoInternal)this).DeleteOrUpdateBehavior = (string) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfoInternal)this).DeleteOrUpdateBehavior, global::System.Convert.ToString); } if (content.Contains("Role")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfoInternal)this).Role = (string[]) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfoInternal)this).Role, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfoInternal)this).Role = (System.Collections.Generic.List) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfoInternal)this).Role, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("AuthType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType = (string) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -177,6 +185,18 @@ internal ServicePrincipalCertificateAuthInfo(global::System.Management.Automatio /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The authentication info when authType is servicePrincipal certificate [System.ComponentModel.TypeConverter(typeof(ServicePrincipalCertificateAuthInfoTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ServicePrincipalCertificateAuthInfo.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServicePrincipalCertificateAuthInfo.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ServicePrincipalCertificateAuthInfo.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServicePrincipalCertificateAuthInfo.TypeConverter.cs index 302ca2e5b084..c5caf8cd8f89 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ServicePrincipalCertificateAuthInfo.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServicePrincipalCertificateAuthInfo.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -108,14 +108,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ServicePrincipalCertificateAuthInfo.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServicePrincipalCertificateAuthInfo.cs similarity index 79% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ServicePrincipalCertificateAuthInfo.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServicePrincipalCertificateAuthInfo.cs index 471f3767d7a7..d238073a73d8 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ServicePrincipalCertificateAuthInfo.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServicePrincipalCertificateAuthInfo.cs @@ -3,25 +3,25 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The authentication info when authType is servicePrincipal certificate public partial class ServicePrincipalCertificateAuthInfo : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfo, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfo, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfoInternal, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AuthInfoBase(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AuthInfoBase(); /// The authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Constant] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType AuthType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)__authInfoBase).AuthType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)__authInfoBase).AuthType = value ; } + public string AuthType { get => "servicePrincipalCertificate"; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)__authInfoBase).AuthType = "servicePrincipalCertificate"; } /// Backing field for property. private string _certificate; @@ -38,13 +38,13 @@ public partial class ServicePrincipalCertificateAuthInfo : public string ClientId { get => this._clientId; set => this._clientId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? _deleteOrUpdateBehavior; + private string _deleteOrUpdateBehavior; /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get => this._deleteOrUpdateBehavior; set => this._deleteOrUpdateBehavior = value; } + public string DeleteOrUpdateBehavior { get => this._deleteOrUpdateBehavior; set => this._deleteOrUpdateBehavior = value; } /// Backing field for property. private string _principalId; @@ -54,16 +54,16 @@ public partial class ServicePrincipalCertificateAuthInfo : public string PrincipalId { get => this._principalId; set => this._principalId = value; } /// Backing field for property. - private string[] _role; + private System.Collections.Generic.List _role; /// Optional, this value specifies the Azure roles to be assigned. Automatically [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public string[] Role { get => this._role; set => this._role = value; } + public System.Collections.Generic.List Role { get => this._role; set => this._role = value; } /// Creates an new instance. public ServicePrincipalCertificateAuthInfo() { - + this.__authInfoBase.AuthType = "servicePrincipalCertificate"; } /// Validates that this object meets the validation criteria. @@ -81,12 +81,15 @@ public ServicePrincipalCertificateAuthInfo() /// The authentication info when authType is servicePrincipal certificate public partial interface IServicePrincipalCertificateAuthInfo : Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase { /// ServicePrincipal certificate for servicePrincipal auth. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"ServicePrincipal certificate for servicePrincipal auth.", SerializedName = @"certificate", PossibleTypes = new [] { typeof(string) })] @@ -95,6 +98,9 @@ public partial interface IServicePrincipalCertificateAuthInfo : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Application clientId for servicePrincipal auth.", SerializedName = @"clientId", PossibleTypes = new [] { typeof(string) })] @@ -105,14 +111,21 @@ public partial interface IServicePrincipalCertificateAuthInfo : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether to clean up previous operation when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string DeleteOrUpdateBehavior { get; set; } /// Principal Id for servicePrincipal auth. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Principal Id for servicePrincipal auth.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -121,15 +134,18 @@ public partial interface IServicePrincipalCertificateAuthInfo : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Optional, this value specifies the Azure roles to be assigned. Automatically ", SerializedName = @"roles", PossibleTypes = new [] { typeof(string) })] - string[] Role { get; set; } + System.Collections.Generic.List Role { get; set; } } /// The authentication info when authType is servicePrincipal certificate internal partial interface IServicePrincipalCertificateAuthInfoInternal : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal { /// ServicePrincipal certificate for servicePrincipal auth. string Certificate { get; set; } @@ -138,11 +154,12 @@ internal partial interface IServicePrincipalCertificateAuthInfoInternal : /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string DeleteOrUpdateBehavior { get; set; } /// Principal Id for servicePrincipal auth. string PrincipalId { get; set; } /// Optional, this value specifies the Azure roles to be assigned. Automatically - string[] Role { get; set; } + System.Collections.Generic.List Role { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ServicePrincipalCertificateAuthInfo.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServicePrincipalCertificateAuthInfo.json.cs similarity index 91% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ServicePrincipalCertificateAuthInfo.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServicePrincipalCertificateAuthInfo.json.cs index 95442d2d71db..8e922e80a571 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ServicePrincipalCertificateAuthInfo.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServicePrincipalCertificateAuthInfo.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServicePrincipalCertificateAuthInfo partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalCertificateAuthInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalCertificateAuthInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new ServicePrincipalCertificateAuthInfo(json) : null; } @@ -77,12 +77,12 @@ internal ServicePrincipalCertificateAuthInfo(Microsoft.Azure.PowerShell.Cmdlets. { return; } - __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AuthInfoBase(json); - {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)ClientId;} - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_certificate = If( json?.PropertyT("certificate"), out var __jsonCertificate) ? (string)__jsonCertificate : (string)Certificate;} - {_deleteOrUpdateBehavior = If( json?.PropertyT("deleteOrUpdateBehavior"), out var __jsonDeleteOrUpdateBehavior) ? (string)__jsonDeleteOrUpdateBehavior : (string)DeleteOrUpdateBehavior;} - {_role = If( json?.PropertyT("roles"), out var __jsonRoles) ? If( __jsonRoles as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Role;} + __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AuthInfoBase(json); + {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)_clientId;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_certificate = If( json?.PropertyT("certificate"), out var __jsonCertificate) ? (string)__jsonCertificate : (string)_certificate;} + {_deleteOrUpdateBehavior = If( json?.PropertyT("deleteOrUpdateBehavior"), out var __jsonDeleteOrUpdateBehavior) ? (string)__jsonDeleteOrUpdateBehavior : (string)_deleteOrUpdateBehavior;} + {_role = If( json?.PropertyT("roles"), out var __jsonRoles) ? If( __jsonRoles as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _role;} AfterFromJson(json); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ServicePrincipalSecretAuthInfo.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServicePrincipalSecretAuthInfo.PowerShell.cs similarity index 60% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ServicePrincipalSecretAuthInfo.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServicePrincipalSecretAuthInfo.PowerShell.cs index 7c303593cb67..72055b7f5d2d 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ServicePrincipalSecretAuthInfo.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServicePrincipalSecretAuthInfo.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ServicePrincipalSecretAuthInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ServicePrincipalSecretAuthInfo(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ServicePrincipalSecretAuthInfo(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,37 +111,37 @@ internal ServicePrincipalSecretAuthInfo(global::System.Collections.IDictionary c // actually deserialize if (content.Contains("ClientId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfoInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfoInternal)this).ClientId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfoInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfoInternal)this).ClientId, global::System.Convert.ToString); } if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfoInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfoInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfoInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfoInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("Secret")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfoInternal)this).Secret = (string) content.GetValueForProperty("Secret",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfoInternal)this).Secret, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfoInternal)this).Secret = (string) content.GetValueForProperty("Secret",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfoInternal)this).Secret, global::System.Convert.ToString); } if (content.Contains("DeleteOrUpdateBehavior")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfoInternal)this).DeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfoInternal)this).DeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfoInternal)this).DeleteOrUpdateBehavior = (string) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfoInternal)this).DeleteOrUpdateBehavior, global::System.Convert.ToString); } if (content.Contains("Role")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfoInternal)this).Role = (string[]) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfoInternal)this).Role, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfoInternal)this).Role = (System.Collections.Generic.List) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfoInternal)this).Role, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("AuthType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType = (string) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType, global::System.Convert.ToString); } if (content.Contains("UserName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)this).UserName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)this).UserName, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -150,31 +156,31 @@ internal ServicePrincipalSecretAuthInfo(global::System.Management.Automation.PSO // actually deserialize if (content.Contains("ClientId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfoInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfoInternal)this).ClientId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfoInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfoInternal)this).ClientId, global::System.Convert.ToString); } if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfoInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfoInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfoInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfoInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("Secret")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfoInternal)this).Secret = (string) content.GetValueForProperty("Secret",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfoInternal)this).Secret, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfoInternal)this).Secret = (string) content.GetValueForProperty("Secret",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfoInternal)this).Secret, global::System.Convert.ToString); } if (content.Contains("DeleteOrUpdateBehavior")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfoInternal)this).DeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfoInternal)this).DeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfoInternal)this).DeleteOrUpdateBehavior = (string) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfoInternal)this).DeleteOrUpdateBehavior, global::System.Convert.ToString); } if (content.Contains("Role")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfoInternal)this).Role = (string[]) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfoInternal)this).Role, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfoInternal)this).Role = (System.Collections.Generic.List) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfoInternal)this).Role, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("AuthType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType = (string) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType, global::System.Convert.ToString); } if (content.Contains("UserName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)this).UserName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)this).UserName, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -183,6 +189,18 @@ internal ServicePrincipalSecretAuthInfo(global::System.Management.Automation.PSO /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The authentication info when authType is servicePrincipal secret [System.ComponentModel.TypeConverter(typeof(ServicePrincipalSecretAuthInfoTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ServicePrincipalSecretAuthInfo.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServicePrincipalSecretAuthInfo.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ServicePrincipalSecretAuthInfo.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServicePrincipalSecretAuthInfo.TypeConverter.cs index f5637326022e..0c62796582d0 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ServicePrincipalSecretAuthInfo.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServicePrincipalSecretAuthInfo.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ServicePrincipalSecretAuthInfo.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServicePrincipalSecretAuthInfo.cs similarity index 77% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ServicePrincipalSecretAuthInfo.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServicePrincipalSecretAuthInfo.cs index e47a95595ca3..919dc0c6cdb0 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ServicePrincipalSecretAuthInfo.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServicePrincipalSecretAuthInfo.cs @@ -3,31 +3,31 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The authentication info when authType is servicePrincipal secret public partial class ServicePrincipalSecretAuthInfo : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfo, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfo, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfoInternal, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AuthInfoBase(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AuthInfoBase(); /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfo __databaseAadAuthInfo = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DatabaseAadAuthInfo(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfo __databaseAadAuthInfo = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DatabaseAadAuthInfo(); /// The authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Constant] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType AuthType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)__authInfoBase).AuthType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)__authInfoBase).AuthType = value ; } + public string AuthType { get => "servicePrincipalSecret"; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)__authInfoBase).AuthType = "servicePrincipalSecret"; } /// Backing field for property. private string _clientId; @@ -37,13 +37,13 @@ public partial class ServicePrincipalSecretAuthInfo : public string ClientId { get => this._clientId; set => this._clientId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? _deleteOrUpdateBehavior; + private string _deleteOrUpdateBehavior; /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get => this._deleteOrUpdateBehavior; set => this._deleteOrUpdateBehavior = value; } + public string DeleteOrUpdateBehavior { get => this._deleteOrUpdateBehavior; set => this._deleteOrUpdateBehavior = value; } /// Backing field for property. private string _principalId; @@ -53,11 +53,11 @@ public partial class ServicePrincipalSecretAuthInfo : public string PrincipalId { get => this._principalId; set => this._principalId = value; } /// Backing field for property. - private string[] _role; + private System.Collections.Generic.List _role; /// Optional, this value specifies the Azure roles to be assigned. Automatically [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public string[] Role { get => this._role; set => this._role = value; } + public System.Collections.Generic.List Role { get => this._role; set => this._role = value; } /// Backing field for property. private string _secret; @@ -68,12 +68,12 @@ public partial class ServicePrincipalSecretAuthInfo : /// Username created in the database which is mapped to a user in AAD. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public string UserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)__databaseAadAuthInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)__databaseAadAuthInfo).UserName = value ?? null; } + public string UserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)__databaseAadAuthInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)__databaseAadAuthInfo).UserName = value ?? null; } /// Creates an new instance. public ServicePrincipalSecretAuthInfo() { - + this.__authInfoBase.AuthType = "servicePrincipalSecret"; } /// Validates that this object meets the validation criteria. @@ -93,13 +93,16 @@ public ServicePrincipalSecretAuthInfo() /// The authentication info when authType is servicePrincipal secret public partial interface IServicePrincipalSecretAuthInfo : Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfo { /// ServicePrincipal application clientId for servicePrincipal auth. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"ServicePrincipal application clientId for servicePrincipal auth.", SerializedName = @"clientId", PossibleTypes = new [] { typeof(string) })] @@ -110,14 +113,21 @@ public partial interface IServicePrincipalSecretAuthInfo : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether to clean up previous operation when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string DeleteOrUpdateBehavior { get; set; } /// Principal Id for servicePrincipal auth. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Principal Id for servicePrincipal auth.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -126,14 +136,20 @@ public partial interface IServicePrincipalSecretAuthInfo : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Optional, this value specifies the Azure roles to be assigned. Automatically ", SerializedName = @"roles", PossibleTypes = new [] { typeof(string) })] - string[] Role { get; set; } + System.Collections.Generic.List Role { get; set; } /// Secret for servicePrincipal auth. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Secret for servicePrincipal auth.", SerializedName = @"secret", PossibleTypes = new [] { typeof(string) })] @@ -142,19 +158,20 @@ public partial interface IServicePrincipalSecretAuthInfo : } /// The authentication info when authType is servicePrincipal secret internal partial interface IServicePrincipalSecretAuthInfoInternal : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal { /// ServicePrincipal application clientId for servicePrincipal auth. string ClientId { get; set; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string DeleteOrUpdateBehavior { get; set; } /// Principal Id for servicePrincipal auth. string PrincipalId { get; set; } /// Optional, this value specifies the Azure roles to be assigned. Automatically - string[] Role { get; set; } + System.Collections.Generic.List Role { get; set; } /// Secret for servicePrincipal auth. string Secret { get; set; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ServicePrincipalSecretAuthInfo.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServicePrincipalSecretAuthInfo.json.cs similarity index 90% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ServicePrincipalSecretAuthInfo.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServicePrincipalSecretAuthInfo.json.cs index c0f8d2d92f16..7249d117e6a2 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ServicePrincipalSecretAuthInfo.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ServicePrincipalSecretAuthInfo.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServicePrincipalSecretAuthInfo partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IServicePrincipalSecretAuthInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServicePrincipalSecretAuthInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new ServicePrincipalSecretAuthInfo(json) : null; } @@ -77,13 +77,13 @@ internal ServicePrincipalSecretAuthInfo(Microsoft.Azure.PowerShell.Cmdlets.Servi { return; } - __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AuthInfoBase(json); - __databaseAadAuthInfo = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DatabaseAadAuthInfo(json); - {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)ClientId;} - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_secret = If( json?.PropertyT("secret"), out var __jsonSecret) ? (string)__jsonSecret : (string)Secret;} - {_deleteOrUpdateBehavior = If( json?.PropertyT("deleteOrUpdateBehavior"), out var __jsonDeleteOrUpdateBehavior) ? (string)__jsonDeleteOrUpdateBehavior : (string)DeleteOrUpdateBehavior;} - {_role = If( json?.PropertyT("roles"), out var __jsonRoles) ? If( __jsonRoles as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Role;} + __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AuthInfoBase(json); + __databaseAadAuthInfo = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DatabaseAadAuthInfo(json); + {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)_clientId;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_secret = If( json?.PropertyT("secret"), out var __jsonSecret) ? (string)__jsonSecret : (string)_secret;} + {_deleteOrUpdateBehavior = If( json?.PropertyT("deleteOrUpdateBehavior"), out var __jsonDeleteOrUpdateBehavior) ? (string)__jsonDeleteOrUpdateBehavior : (string)_deleteOrUpdateBehavior;} + {_role = If( json?.PropertyT("roles"), out var __jsonRoles) ? If( __jsonRoles as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _role;} AfterFromJson(json); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SourceConfiguration.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SourceConfiguration.PowerShell.cs similarity index 74% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SourceConfiguration.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SourceConfiguration.PowerShell.cs index c73a95d8fb31..085aae62e301 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SourceConfiguration.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SourceConfiguration.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class SourceConfiguration partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SourceConfiguration(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SourceConfiguration(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,17 +111,17 @@ internal SourceConfiguration(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfigurationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfigurationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfigurationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfigurationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfigurationInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfigurationInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfigurationInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfigurationInternal)this).Value, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -130,11 +136,11 @@ internal SourceConfiguration(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfigurationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfigurationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfigurationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfigurationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfigurationInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfigurationInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfigurationInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfigurationInternal)this).Value, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -143,6 +149,18 @@ internal SourceConfiguration(global::System.Management.Automation.PSObject conte /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// A configuration item for source resource [System.ComponentModel.TypeConverter(typeof(SourceConfigurationTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SourceConfiguration.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SourceConfiguration.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SourceConfiguration.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SourceConfiguration.TypeConverter.cs index e7c62e5bf48a..c9f8a9713fd6 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SourceConfiguration.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SourceConfiguration.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SourceConfiguration.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SourceConfiguration.cs similarity index 93% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SourceConfiguration.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SourceConfiguration.cs index 3a9f5c30549e..1cdd051dd728 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SourceConfiguration.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SourceConfiguration.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// A configuration item for source resource public partial class SourceConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfigurationInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfigurationInternal { /// Backing field for property. @@ -41,6 +41,9 @@ public partial interface ISourceConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of setting.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -49,6 +52,9 @@ public partial interface ISourceConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The value of setting", SerializedName = @"value", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SourceConfiguration.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SourceConfiguration.json.cs similarity index 94% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SourceConfiguration.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SourceConfiguration.json.cs index 45fc761cf5bd..678581043c2c 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SourceConfiguration.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SourceConfiguration.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SourceConfiguration partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfiguration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfiguration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISourceConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new SourceConfiguration(json) : null; } @@ -77,8 +77,8 @@ internal SourceConfiguration(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Ru { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)_value;} AfterFromJson(json); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SystemAssignedIdentityAuthInfo.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SystemAssignedIdentityAuthInfo.PowerShell.cs similarity index 66% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SystemAssignedIdentityAuthInfo.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SystemAssignedIdentityAuthInfo.PowerShell.cs index b37c3ba580e2..2fdfb8a06f70 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SystemAssignedIdentityAuthInfo.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SystemAssignedIdentityAuthInfo.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class SystemAssignedIdentityAuthInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISystemAssignedIdentityAuthInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemAssignedIdentityAuthInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SystemAssignedIdentityAuthInfo(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISystemAssignedIdentityAuthInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemAssignedIdentityAuthInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SystemAssignedIdentityAuthInfo(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISystemAssignedIdentityAuthInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemAssignedIdentityAuthInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,25 +111,25 @@ internal SystemAssignedIdentityAuthInfo(global::System.Collections.IDictionary c // actually deserialize if (content.Contains("DeleteOrUpdateBehavior")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISystemAssignedIdentityAuthInfoInternal)this).DeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISystemAssignedIdentityAuthInfoInternal)this).DeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemAssignedIdentityAuthInfoInternal)this).DeleteOrUpdateBehavior = (string) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemAssignedIdentityAuthInfoInternal)this).DeleteOrUpdateBehavior, global::System.Convert.ToString); } if (content.Contains("Role")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISystemAssignedIdentityAuthInfoInternal)this).Role = (string[]) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISystemAssignedIdentityAuthInfoInternal)this).Role, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemAssignedIdentityAuthInfoInternal)this).Role = (System.Collections.Generic.List) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemAssignedIdentityAuthInfoInternal)this).Role, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("AuthType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType = (string) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType, global::System.Convert.ToString); } if (content.Contains("UserName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)this).UserName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)this).UserName, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -138,19 +144,19 @@ internal SystemAssignedIdentityAuthInfo(global::System.Management.Automation.PSO // actually deserialize if (content.Contains("DeleteOrUpdateBehavior")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISystemAssignedIdentityAuthInfoInternal)this).DeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISystemAssignedIdentityAuthInfoInternal)this).DeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemAssignedIdentityAuthInfoInternal)this).DeleteOrUpdateBehavior = (string) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemAssignedIdentityAuthInfoInternal)this).DeleteOrUpdateBehavior, global::System.Convert.ToString); } if (content.Contains("Role")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISystemAssignedIdentityAuthInfoInternal)this).Role = (string[]) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISystemAssignedIdentityAuthInfoInternal)this).Role, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemAssignedIdentityAuthInfoInternal)this).Role = (System.Collections.Generic.List) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemAssignedIdentityAuthInfoInternal)this).Role, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("AuthType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType = (string) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType, global::System.Convert.ToString); } if (content.Contains("UserName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)this).UserName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)this).UserName, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -159,6 +165,18 @@ internal SystemAssignedIdentityAuthInfo(global::System.Management.Automation.PSO /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The authentication info when authType is systemAssignedIdentity [System.ComponentModel.TypeConverter(typeof(SystemAssignedIdentityAuthInfoTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SystemAssignedIdentityAuthInfo.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SystemAssignedIdentityAuthInfo.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SystemAssignedIdentityAuthInfo.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SystemAssignedIdentityAuthInfo.TypeConverter.cs index 7d5ce33f5b4f..23b469a01090 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SystemAssignedIdentityAuthInfo.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SystemAssignedIdentityAuthInfo.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISystemAssignedIdentityAuthInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemAssignedIdentityAuthInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISystemAssignedIdentityAuthInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemAssignedIdentityAuthInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SystemAssignedIdentityAuthInfo.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SystemAssignedIdentityAuthInfo.cs similarity index 69% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SystemAssignedIdentityAuthInfo.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SystemAssignedIdentityAuthInfo.cs index 4fec753e4cfa..38759b480dcb 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SystemAssignedIdentityAuthInfo.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SystemAssignedIdentityAuthInfo.cs @@ -3,56 +3,56 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The authentication info when authType is systemAssignedIdentity public partial class SystemAssignedIdentityAuthInfo : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISystemAssignedIdentityAuthInfo, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISystemAssignedIdentityAuthInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemAssignedIdentityAuthInfo, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemAssignedIdentityAuthInfoInternal, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AuthInfoBase(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AuthInfoBase(); /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfo __databaseAadAuthInfo = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DatabaseAadAuthInfo(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfo __databaseAadAuthInfo = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DatabaseAadAuthInfo(); /// The authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Constant] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType AuthType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)__authInfoBase).AuthType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)__authInfoBase).AuthType = value ; } + public string AuthType { get => "systemAssignedIdentity"; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)__authInfoBase).AuthType = "systemAssignedIdentity"; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? _deleteOrUpdateBehavior; + private string _deleteOrUpdateBehavior; /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get => this._deleteOrUpdateBehavior; set => this._deleteOrUpdateBehavior = value; } + public string DeleteOrUpdateBehavior { get => this._deleteOrUpdateBehavior; set => this._deleteOrUpdateBehavior = value; } /// Backing field for property. - private string[] _role; + private System.Collections.Generic.List _role; /// Optional, this value specifies the Azure role to be assigned [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public string[] Role { get => this._role; set => this._role = value; } + public System.Collections.Generic.List Role { get => this._role; set => this._role = value; } /// Username created in the database which is mapped to a user in AAD. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public string UserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)__databaseAadAuthInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)__databaseAadAuthInfo).UserName = value ?? null; } + public string UserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)__databaseAadAuthInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)__databaseAadAuthInfo).UserName = value ?? null; } /// Creates an new instance. public SystemAssignedIdentityAuthInfo() { - + this.__authInfoBase.AuthType = "systemAssignedIdentity"; } /// Validates that this object meets the validation criteria. @@ -72,8 +72,8 @@ public SystemAssignedIdentityAuthInfo() /// The authentication info when authType is systemAssignedIdentity public partial interface ISystemAssignedIdentityAuthInfo : Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfo { /// /// Indicates whether to clean up previous operation when Linker is updating or deleting @@ -81,31 +81,39 @@ public partial interface ISystemAssignedIdentityAuthInfo : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether to clean up previous operation when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string DeleteOrUpdateBehavior { get; set; } /// Optional, this value specifies the Azure role to be assigned [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Optional, this value specifies the Azure role to be assigned", SerializedName = @"roles", PossibleTypes = new [] { typeof(string) })] - string[] Role { get; set; } + System.Collections.Generic.List Role { get; set; } } /// The authentication info when authType is systemAssignedIdentity internal partial interface ISystemAssignedIdentityAuthInfoInternal : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal { /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string DeleteOrUpdateBehavior { get; set; } /// Optional, this value specifies the Azure role to be assigned - string[] Role { get; set; } + System.Collections.Generic.List Role { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SystemAssignedIdentityAuthInfo.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SystemAssignedIdentityAuthInfo.json.cs similarity index 90% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SystemAssignedIdentityAuthInfo.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SystemAssignedIdentityAuthInfo.json.cs index f77d4c3895bf..d48bf857d474 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/SystemAssignedIdentityAuthInfo.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SystemAssignedIdentityAuthInfo.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SystemAssignedIdentityAuthInfo partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISystemAssignedIdentityAuthInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemAssignedIdentityAuthInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISystemAssignedIdentityAuthInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemAssignedIdentityAuthInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISystemAssignedIdentityAuthInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemAssignedIdentityAuthInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new SystemAssignedIdentityAuthInfo(json) : null; } @@ -77,10 +77,10 @@ internal SystemAssignedIdentityAuthInfo(Microsoft.Azure.PowerShell.Cmdlets.Servi { return; } - __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AuthInfoBase(json); - __databaseAadAuthInfo = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DatabaseAadAuthInfo(json); - {_deleteOrUpdateBehavior = If( json?.PropertyT("deleteOrUpdateBehavior"), out var __jsonDeleteOrUpdateBehavior) ? (string)__jsonDeleteOrUpdateBehavior : (string)DeleteOrUpdateBehavior;} - {_role = If( json?.PropertyT("roles"), out var __jsonRoles) ? If( __jsonRoles as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Role;} + __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AuthInfoBase(json); + __databaseAadAuthInfo = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DatabaseAadAuthInfo(json); + {_deleteOrUpdateBehavior = If( json?.PropertyT("deleteOrUpdateBehavior"), out var __jsonDeleteOrUpdateBehavior) ? (string)__jsonDeleteOrUpdateBehavior : (string)_deleteOrUpdateBehavior;} + {_role = If( json?.PropertyT("roles"), out var __jsonRoles) ? If( __jsonRoles as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _role;} AfterFromJson(json); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/SystemData.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SystemData.PowerShell.cs similarity index 63% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/SystemData.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SystemData.PowerShell.cs index 0d5630da89b6..72e3a7587beb 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/SystemData.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SystemData.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class SystemData partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SystemData(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SystemData(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISys /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,33 +111,33 @@ internal SystemData(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("CreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); } if (content.Contains("CreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)this).CreatedByType = (string) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)this).CreatedByType, global::System.Convert.ToString); } if (content.Contains("CreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("LastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -144,27 +152,27 @@ internal SystemData(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("CreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); } if (content.Contains("CreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)this).CreatedByType = (string) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)this).CreatedByType, global::System.Convert.ToString); } if (content.Contains("CreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("LastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializePSObject(content); } @@ -173,6 +181,18 @@ internal SystemData(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Metadata pertaining to creation and last modification of the resource. [System.ComponentModel.TypeConverter(typeof(SystemDataTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/SystemData.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SystemData.TypeConverter.cs similarity index 98% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/SystemData.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SystemData.TypeConverter.cs index 2df403b4eaba..cf68d76abcd4 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/SystemData.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SystemData.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/SystemData.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SystemData.cs similarity index 80% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/SystemData.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SystemData.cs index 8b0ec13df116..51f121db78cc 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/SystemData.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SystemData.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// Metadata pertaining to creation and last modification of the resource. public partial class SystemData : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemDataInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemDataInternal { /// Backing field for property. @@ -28,11 +28,11 @@ public partial class SystemData : public string CreatedBy { get => this._createdBy; set => this._createdBy = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType? _createdByType; + private string _createdByType; /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType? CreatedByType { get => this._createdByType; set => this._createdByType = value; } + public string CreatedByType { get => this._createdByType; set => this._createdByType = value; } /// Backing field for property. private global::System.DateTime? _lastModifiedAt; @@ -49,11 +49,11 @@ public partial class SystemData : public string LastModifiedBy { get => this._lastModifiedBy; set => this._lastModifiedBy = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType? _lastModifiedByType; + private string _lastModifiedByType; /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType? LastModifiedByType { get => this._lastModifiedByType; set => this._lastModifiedByType = value; } + public string LastModifiedByType { get => this._lastModifiedByType; set => this._lastModifiedByType = value; } /// Creates an new instance. public SystemData() @@ -69,6 +69,9 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The timestamp of resource creation (UTC).", SerializedName = @"createdAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -77,6 +80,9 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The identity that created the resource.", SerializedName = @"createdBy", PossibleTypes = new [] { typeof(string) })] @@ -85,14 +91,21 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of identity that created the resource.", SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType? CreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string CreatedByType { get; set; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The timestamp of resource last modification (UTC)", SerializedName = @"lastModifiedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -101,6 +114,9 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The identity that last modified the resource.", SerializedName = @"lastModifiedBy", PossibleTypes = new [] { typeof(string) })] @@ -109,10 +125,14 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of identity that last modified the resource.", SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType? LastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string LastModifiedByType { get; set; } } /// Metadata pertaining to creation and last modification of the resource. @@ -124,13 +144,15 @@ internal partial interface ISystemDataInternal /// The identity that created the resource. string CreatedBy { get; set; } /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType? CreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string CreatedByType { get; set; } /// The timestamp of resource last modification (UTC) global::System.DateTime? LastModifiedAt { get; set; } /// The identity that last modified the resource. string LastModifiedBy { get; set; } /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType? LastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string LastModifiedByType { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/SystemData.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SystemData.json.cs similarity index 95% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/SystemData.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SystemData.json.cs index 017fd580f89c..220348b90f5d 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api30/SystemData.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/SystemData.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SystemData partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new SystemData(json) : null; } @@ -77,12 +77,12 @@ internal SystemData(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Jso { return; } - {_createdBy = If( json?.PropertyT("createdBy"), out var __jsonCreatedBy) ? (string)__jsonCreatedBy : (string)CreatedBy;} - {_createdByType = If( json?.PropertyT("createdByType"), out var __jsonCreatedByType) ? (string)__jsonCreatedByType : (string)CreatedByType;} - {_createdAt = If( json?.PropertyT("createdAt"), out var __jsonCreatedAt) ? global::System.DateTime.TryParse((string)__jsonCreatedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedAtValue) ? __jsonCreatedAtValue : CreatedAt : CreatedAt;} - {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? (string)__jsonLastModifiedBy : (string)LastModifiedBy;} - {_lastModifiedByType = If( json?.PropertyT("lastModifiedByType"), out var __jsonLastModifiedByType) ? (string)__jsonLastModifiedByType : (string)LastModifiedByType;} - {_lastModifiedAt = If( json?.PropertyT("lastModifiedAt"), out var __jsonLastModifiedAt) ? global::System.DateTime.TryParse((string)__jsonLastModifiedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedAtValue) ? __jsonLastModifiedAtValue : LastModifiedAt : LastModifiedAt;} + {_createdBy = If( json?.PropertyT("createdBy"), out var __jsonCreatedBy) ? (string)__jsonCreatedBy : (string)_createdBy;} + {_createdByType = If( json?.PropertyT("createdByType"), out var __jsonCreatedByType) ? (string)__jsonCreatedByType : (string)_createdByType;} + {_createdAt = If( json?.PropertyT("createdAt"), out var __jsonCreatedAt) ? global::System.DateTime.TryParse((string)__jsonCreatedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedAtValue) ? __jsonCreatedAtValue : _createdAt : _createdAt;} + {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? (string)__jsonLastModifiedBy : (string)_lastModifiedBy;} + {_lastModifiedByType = If( json?.PropertyT("lastModifiedByType"), out var __jsonLastModifiedByType) ? (string)__jsonLastModifiedByType : (string)_lastModifiedByType;} + {_lastModifiedAt = If( json?.PropertyT("lastModifiedAt"), out var __jsonLastModifiedAt) ? global::System.DateTime.TryParse((string)__jsonLastModifiedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedAtValue) ? __jsonLastModifiedAtValue : _lastModifiedAt : _lastModifiedAt;} AfterFromJson(json); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/TargetServiceBase.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/TargetServiceBase.PowerShell.cs similarity index 77% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/TargetServiceBase.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/TargetServiceBase.PowerShell.cs index e226bbba2d55..6373ef6bcc5c 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/TargetServiceBase.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/TargetServiceBase.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class TargetServiceBase partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new TargetServiceBase(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new TargetServiceBase(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,13 +111,13 @@ internal TargetServiceBase(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal)this).Type, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -126,7 +132,7 @@ internal TargetServiceBase(global::System.Management.Automation.PSObject content // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -135,6 +141,18 @@ internal TargetServiceBase(global::System.Management.Automation.PSObject content /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The target service properties [System.ComponentModel.TypeConverter(typeof(TargetServiceBaseTypeConverter))] diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/TargetServiceBase.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/TargetServiceBase.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/TargetServiceBase.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/TargetServiceBase.TypeConverter.cs index 1df5e5059441..969b427cc3dc 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/TargetServiceBase.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/TargetServiceBase.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/TargetServiceBase.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/TargetServiceBase.cs similarity index 70% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/TargetServiceBase.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/TargetServiceBase.cs index 999c7874f410..0bc10834a069 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/TargetServiceBase.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/TargetServiceBase.cs @@ -3,22 +3,22 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The target service properties public partial class TargetServiceBase : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBaseInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBaseInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType _type; + private string _type; /// The target service type. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType Type { get => this._type; set => this._type = value; } + public string Type { get => this._type; set => this._type = value; } /// Creates an new instance. public TargetServiceBase() @@ -34,10 +34,14 @@ public partial interface ITargetServiceBase : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The target service type.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType Type { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("AzureResource", "ConfluentBootstrapServer", "ConfluentSchemaRegistry", "SelfHostedServer")] + string Type { get; set; } } /// The target service properties @@ -45,7 +49,8 @@ internal partial interface ITargetServiceBaseInternal { /// The target service type. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType Type { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("AzureResource", "ConfluentBootstrapServer", "ConfluentSchemaRegistry", "SelfHostedServer")] + string Type { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/TargetServiceBase.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/TargetServiceBase.json.cs similarity index 93% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/TargetServiceBase.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/TargetServiceBase.json.cs index f9881faa04fb..38203511c1d4 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/TargetServiceBase.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/TargetServiceBase.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -54,15 +54,15 @@ public partial class TargetServiceBase partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase. - /// Note: the Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase interface is polymorphic, - /// and the precise model class that will get deserialized is determined at runtime based on the payload. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase interface is polymorphic, and the + /// precise model class that will get deserialized is determined at runtime based on the payload. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { if (!(node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json)) { @@ -104,7 +104,7 @@ internal TargetServiceBase(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runt { return; } - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/UserAccountAuthInfo.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/UserAccountAuthInfo.PowerShell.cs similarity index 65% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/UserAccountAuthInfo.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/UserAccountAuthInfo.PowerShell.cs index 47a9a3e2fd51..1c24e9cbdc6c 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/UserAccountAuthInfo.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/UserAccountAuthInfo.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class UserAccountAuthInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAccountAuthInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAccountAuthInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new UserAccountAuthInfo(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAccountAuthInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAccountAuthInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new UserAccountAuthInfo(content); } @@ -87,15 +93,27 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAccountAuthInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAccountAuthInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -110,29 +128,29 @@ internal UserAccountAuthInfo(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAccountAuthInfoInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAccountAuthInfoInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAccountAuthInfoInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAccountAuthInfoInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("DeleteOrUpdateBehavior")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAccountAuthInfoInternal)this).DeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAccountAuthInfoInternal)this).DeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAccountAuthInfoInternal)this).DeleteOrUpdateBehavior = (string) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAccountAuthInfoInternal)this).DeleteOrUpdateBehavior, global::System.Convert.ToString); } if (content.Contains("Role")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAccountAuthInfoInternal)this).Role = (string[]) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAccountAuthInfoInternal)this).Role, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAccountAuthInfoInternal)this).Role = (System.Collections.Generic.List) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAccountAuthInfoInternal)this).Role, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("AuthType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType = (string) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType, global::System.Convert.ToString); } if (content.Contains("UserName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)this).UserName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)this).UserName, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -147,23 +165,23 @@ internal UserAccountAuthInfo(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAccountAuthInfoInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAccountAuthInfoInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAccountAuthInfoInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAccountAuthInfoInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("DeleteOrUpdateBehavior")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAccountAuthInfoInternal)this).DeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAccountAuthInfoInternal)this).DeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAccountAuthInfoInternal)this).DeleteOrUpdateBehavior = (string) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAccountAuthInfoInternal)this).DeleteOrUpdateBehavior, global::System.Convert.ToString); } if (content.Contains("Role")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAccountAuthInfoInternal)this).Role = (string[]) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAccountAuthInfoInternal)this).Role, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAccountAuthInfoInternal)this).Role = (System.Collections.Generic.List) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAccountAuthInfoInternal)this).Role, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("AuthType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType = (string) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType, global::System.Convert.ToString); } if (content.Contains("UserName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)this).UserName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)this).UserName, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/UserAccountAuthInfo.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/UserAccountAuthInfo.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/UserAccountAuthInfo.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/UserAccountAuthInfo.TypeConverter.cs index f07a5536fa9e..766c209b08fc 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/UserAccountAuthInfo.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/UserAccountAuthInfo.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAccountAuthInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAccountAuthInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAccountAuthInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAccountAuthInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/UserAccountAuthInfo.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/UserAccountAuthInfo.cs similarity index 72% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/UserAccountAuthInfo.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/UserAccountAuthInfo.cs index d3b77adc3944..01b2e559cfc2 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/UserAccountAuthInfo.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/UserAccountAuthInfo.cs @@ -3,40 +3,40 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The authentication info when authType is user account public partial class UserAccountAuthInfo : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAccountAuthInfo, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAccountAuthInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAccountAuthInfo, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAccountAuthInfoInternal, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AuthInfoBase(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AuthInfoBase(); /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfo __databaseAadAuthInfo = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DatabaseAadAuthInfo(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfo __databaseAadAuthInfo = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DatabaseAadAuthInfo(); /// The authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Constant] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType AuthType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)__authInfoBase).AuthType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)__authInfoBase).AuthType = value ; } + public string AuthType { get => "userAccount"; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)__authInfoBase).AuthType = "userAccount"; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? _deleteOrUpdateBehavior; + private string _deleteOrUpdateBehavior; /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get => this._deleteOrUpdateBehavior; set => this._deleteOrUpdateBehavior = value; } + public string DeleteOrUpdateBehavior { get => this._deleteOrUpdateBehavior; set => this._deleteOrUpdateBehavior = value; } /// Backing field for property. private string _principalId; @@ -46,20 +46,20 @@ public partial class UserAccountAuthInfo : public string PrincipalId { get => this._principalId; set => this._principalId = value; } /// Backing field for property. - private string[] _role; + private System.Collections.Generic.List _role; /// Optional, this value specifies the Azure roles to be assigned. Automatically [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public string[] Role { get => this._role; set => this._role = value; } + public System.Collections.Generic.List Role { get => this._role; set => this._role = value; } /// Username created in the database which is mapped to a user in AAD. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public string UserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)__databaseAadAuthInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)__databaseAadAuthInfo).UserName = value ?? null; } + public string UserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)__databaseAadAuthInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)__databaseAadAuthInfo).UserName = value ?? null; } /// Creates an new instance. public UserAccountAuthInfo() { - + this.__authInfoBase.AuthType = "userAccount"; } /// Validates that this object meets the validation criteria. @@ -79,8 +79,8 @@ public UserAccountAuthInfo() /// The authentication info when authType is user account public partial interface IUserAccountAuthInfo : Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfo { /// /// Indicates whether to clean up previous operation when Linker is updating or deleting @@ -88,14 +88,21 @@ public partial interface IUserAccountAuthInfo : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether to clean up previous operation when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string DeleteOrUpdateBehavior { get; set; } /// Principal Id for user account. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Principal Id for user account.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -104,25 +111,29 @@ public partial interface IUserAccountAuthInfo : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Optional, this value specifies the Azure roles to be assigned. Automatically ", SerializedName = @"roles", PossibleTypes = new [] { typeof(string) })] - string[] Role { get; set; } + System.Collections.Generic.List Role { get; set; } } /// The authentication info when authType is user account internal partial interface IUserAccountAuthInfoInternal : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal { /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string DeleteOrUpdateBehavior { get; set; } /// Principal Id for user account. string PrincipalId { get; set; } /// Optional, this value specifies the Azure roles to be assigned. Automatically - string[] Role { get; set; } + System.Collections.Generic.List Role { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/UserAccountAuthInfo.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/UserAccountAuthInfo.json.cs similarity index 90% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/UserAccountAuthInfo.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/UserAccountAuthInfo.json.cs index 5f410a0b4e3c..3da485c7c2ca 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/UserAccountAuthInfo.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/UserAccountAuthInfo.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class UserAccountAuthInfo partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAccountAuthInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAccountAuthInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAccountAuthInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAccountAuthInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAccountAuthInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAccountAuthInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new UserAccountAuthInfo(json) : null; } @@ -113,11 +113,11 @@ internal UserAccountAuthInfo(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Ru { return; } - __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AuthInfoBase(json); - __databaseAadAuthInfo = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DatabaseAadAuthInfo(json); - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_deleteOrUpdateBehavior = If( json?.PropertyT("deleteOrUpdateBehavior"), out var __jsonDeleteOrUpdateBehavior) ? (string)__jsonDeleteOrUpdateBehavior : (string)DeleteOrUpdateBehavior;} - {_role = If( json?.PropertyT("roles"), out var __jsonRoles) ? If( __jsonRoles as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Role;} + __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AuthInfoBase(json); + __databaseAadAuthInfo = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DatabaseAadAuthInfo(json); + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_deleteOrUpdateBehavior = If( json?.PropertyT("deleteOrUpdateBehavior"), out var __jsonDeleteOrUpdateBehavior) ? (string)__jsonDeleteOrUpdateBehavior : (string)_deleteOrUpdateBehavior;} + {_role = If( json?.PropertyT("roles"), out var __jsonRoles) ? If( __jsonRoles as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _role;} AfterFromJson(json); } } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/UserAssignedIdentityAuthInfo.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/UserAssignedIdentityAuthInfo.PowerShell.cs similarity index 62% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/UserAssignedIdentityAuthInfo.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/UserAssignedIdentityAuthInfo.PowerShell.cs index bc9da8a6d531..d2186b3e0dc6 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/UserAssignedIdentityAuthInfo.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/UserAssignedIdentityAuthInfo.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class UserAssignedIdentityAuthInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAssignedIdentityAuthInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAssignedIdentityAuthInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new UserAssignedIdentityAuthInfo(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAssignedIdentityAuthInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAssignedIdentityAuthInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new UserAssignedIdentityAuthInfo(content); } @@ -87,15 +93,27 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAssignedIdentityAuthInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAssignedIdentityAuthInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -110,33 +128,33 @@ internal UserAssignedIdentityAuthInfo(global::System.Collections.IDictionary con // actually deserialize if (content.Contains("ClientId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAssignedIdentityAuthInfoInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAssignedIdentityAuthInfoInternal)this).ClientId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAssignedIdentityAuthInfoInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAssignedIdentityAuthInfoInternal)this).ClientId, global::System.Convert.ToString); } if (content.Contains("SubscriptionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAssignedIdentityAuthInfoInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAssignedIdentityAuthInfoInternal)this).SubscriptionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAssignedIdentityAuthInfoInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAssignedIdentityAuthInfoInternal)this).SubscriptionId, global::System.Convert.ToString); } if (content.Contains("DeleteOrUpdateBehavior")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAssignedIdentityAuthInfoInternal)this).DeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAssignedIdentityAuthInfoInternal)this).DeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAssignedIdentityAuthInfoInternal)this).DeleteOrUpdateBehavior = (string) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAssignedIdentityAuthInfoInternal)this).DeleteOrUpdateBehavior, global::System.Convert.ToString); } if (content.Contains("Role")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAssignedIdentityAuthInfoInternal)this).Role = (string[]) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAssignedIdentityAuthInfoInternal)this).Role, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAssignedIdentityAuthInfoInternal)this).Role = (System.Collections.Generic.List) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAssignedIdentityAuthInfoInternal)this).Role, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("AuthType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType = (string) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType, global::System.Convert.ToString); } if (content.Contains("UserName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)this).UserName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)this).UserName, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -151,27 +169,27 @@ internal UserAssignedIdentityAuthInfo(global::System.Management.Automation.PSObj // actually deserialize if (content.Contains("ClientId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAssignedIdentityAuthInfoInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAssignedIdentityAuthInfoInternal)this).ClientId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAssignedIdentityAuthInfoInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAssignedIdentityAuthInfoInternal)this).ClientId, global::System.Convert.ToString); } if (content.Contains("SubscriptionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAssignedIdentityAuthInfoInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAssignedIdentityAuthInfoInternal)this).SubscriptionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAssignedIdentityAuthInfoInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAssignedIdentityAuthInfoInternal)this).SubscriptionId, global::System.Convert.ToString); } if (content.Contains("DeleteOrUpdateBehavior")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAssignedIdentityAuthInfoInternal)this).DeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAssignedIdentityAuthInfoInternal)this).DeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAssignedIdentityAuthInfoInternal)this).DeleteOrUpdateBehavior = (string) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAssignedIdentityAuthInfoInternal)this).DeleteOrUpdateBehavior, global::System.Convert.ToString); } if (content.Contains("Role")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAssignedIdentityAuthInfoInternal)this).Role = (string[]) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAssignedIdentityAuthInfoInternal)this).Role, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAssignedIdentityAuthInfoInternal)this).Role = (System.Collections.Generic.List) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAssignedIdentityAuthInfoInternal)this).Role, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("AuthType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType = (string) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)this).AuthType, global::System.Convert.ToString); } if (content.Contains("UserName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)this).UserName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)this).UserName, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/UserAssignedIdentityAuthInfo.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/UserAssignedIdentityAuthInfo.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/UserAssignedIdentityAuthInfo.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/UserAssignedIdentityAuthInfo.TypeConverter.cs index 2d4880f1f5ff..13b21c086852 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/UserAssignedIdentityAuthInfo.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/UserAssignedIdentityAuthInfo.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAssignedIdentityAuthInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAssignedIdentityAuthInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAssignedIdentityAuthInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAssignedIdentityAuthInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/UserAssignedIdentityAuthInfo.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/UserAssignedIdentityAuthInfo.cs similarity index 75% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/UserAssignedIdentityAuthInfo.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/UserAssignedIdentityAuthInfo.cs index f030fe7f0d25..ad7ab3909faa 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/UserAssignedIdentityAuthInfo.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/UserAssignedIdentityAuthInfo.cs @@ -3,31 +3,31 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The authentication info when authType is userAssignedIdentity public partial class UserAssignedIdentityAuthInfo : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAssignedIdentityAuthInfo, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAssignedIdentityAuthInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAssignedIdentityAuthInfo, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAssignedIdentityAuthInfoInternal, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AuthInfoBase(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AuthInfoBase(); /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfo __databaseAadAuthInfo = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DatabaseAadAuthInfo(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfo __databaseAadAuthInfo = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DatabaseAadAuthInfo(); /// The authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Constant] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType AuthType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)__authInfoBase).AuthType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal)__authInfoBase).AuthType = value ; } + public string AuthType { get => "userAssignedIdentity"; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal)__authInfoBase).AuthType = "userAssignedIdentity"; } /// Backing field for property. private string _clientId; @@ -37,20 +37,20 @@ public partial class UserAssignedIdentityAuthInfo : public string ClientId { get => this._clientId; set => this._clientId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? _deleteOrUpdateBehavior; + private string _deleteOrUpdateBehavior; /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get => this._deleteOrUpdateBehavior; set => this._deleteOrUpdateBehavior = value; } + public string DeleteOrUpdateBehavior { get => this._deleteOrUpdateBehavior; set => this._deleteOrUpdateBehavior = value; } /// Backing field for property. - private string[] _role; + private System.Collections.Generic.List _role; /// Optional, this value specifies the Azure role to be assigned [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public string[] Role { get => this._role; set => this._role = value; } + public System.Collections.Generic.List Role { get => this._role; set => this._role = value; } /// Backing field for property. private string _subscriptionId; @@ -61,12 +61,12 @@ public partial class UserAssignedIdentityAuthInfo : /// Username created in the database which is mapped to a user in AAD. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public string UserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)__databaseAadAuthInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal)__databaseAadAuthInfo).UserName = value ?? null; } + public string UserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)__databaseAadAuthInfo).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal)__databaseAadAuthInfo).UserName = value ?? null; } /// Creates an new instance. public UserAssignedIdentityAuthInfo() { - + this.__authInfoBase.AuthType = "userAssignedIdentity"; } /// Validates that this object meets the validation criteria. @@ -86,13 +86,16 @@ public UserAssignedIdentityAuthInfo() /// The authentication info when authType is userAssignedIdentity public partial interface IUserAssignedIdentityAuthInfo : Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfo + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfo { /// Client Id for userAssignedIdentity. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Client Id for userAssignedIdentity.", SerializedName = @"clientId", PossibleTypes = new [] { typeof(string) })] @@ -103,22 +106,32 @@ public partial interface IUserAssignedIdentityAuthInfo : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether to clean up previous operation when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string DeleteOrUpdateBehavior { get; set; } /// Optional, this value specifies the Azure role to be assigned [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Optional, this value specifies the Azure role to be assigned", SerializedName = @"roles", PossibleTypes = new [] { typeof(string) })] - string[] Role { get; set; } + System.Collections.Generic.List Role { get; set; } /// Subscription id for userAssignedIdentity. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Subscription id for userAssignedIdentity.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] @@ -127,17 +140,18 @@ public partial interface IUserAssignedIdentityAuthInfo : } /// The authentication info when authType is userAssignedIdentity internal partial interface IUserAssignedIdentityAuthInfoInternal : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBaseInternal, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDatabaseAadAuthInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBaseInternal, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDatabaseAadAuthInfoInternal { /// Client Id for userAssignedIdentity. string ClientId { get; set; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string DeleteOrUpdateBehavior { get; set; } /// Optional, this value specifies the Azure role to be assigned - string[] Role { get; set; } + System.Collections.Generic.List Role { get; set; } /// Subscription id for userAssignedIdentity. string SubscriptionId { get; set; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/UserAssignedIdentityAuthInfo.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/UserAssignedIdentityAuthInfo.json.cs similarity index 90% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/UserAssignedIdentityAuthInfo.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/UserAssignedIdentityAuthInfo.json.cs index 9ac658c96e9c..c976d5b3209c 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/UserAssignedIdentityAuthInfo.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/UserAssignedIdentityAuthInfo.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class UserAssignedIdentityAuthInfo partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAssignedIdentityAuthInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAssignedIdentityAuthInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAssignedIdentityAuthInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAssignedIdentityAuthInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IUserAssignedIdentityAuthInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IUserAssignedIdentityAuthInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new UserAssignedIdentityAuthInfo(json) : null; } @@ -114,12 +114,12 @@ internal UserAssignedIdentityAuthInfo(Microsoft.Azure.PowerShell.Cmdlets.Service { return; } - __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.AuthInfoBase(json); - __databaseAadAuthInfo = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DatabaseAadAuthInfo(json); - {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)ClientId;} - {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} - {_deleteOrUpdateBehavior = If( json?.PropertyT("deleteOrUpdateBehavior"), out var __jsonDeleteOrUpdateBehavior) ? (string)__jsonDeleteOrUpdateBehavior : (string)DeleteOrUpdateBehavior;} - {_role = If( json?.PropertyT("roles"), out var __jsonRoles) ? If( __jsonRoles as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Role;} + __authInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.AuthInfoBase(json); + __databaseAadAuthInfo = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DatabaseAadAuthInfo(json); + {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)_clientId;} + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)_subscriptionId;} + {_deleteOrUpdateBehavior = If( json?.PropertyT("deleteOrUpdateBehavior"), out var __jsonDeleteOrUpdateBehavior) ? (string)__jsonDeleteOrUpdateBehavior : (string)_deleteOrUpdateBehavior;} + {_role = If( json?.PropertyT("roles"), out var __jsonRoles) ? If( __jsonRoles as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _role;} AfterFromJson(json); } } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/VNetSolution.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/VNetSolution.PowerShell.cs similarity index 74% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/VNetSolution.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/VNetSolution.PowerShell.cs index 29a8b848d527..43337285af11 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/VNetSolution.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/VNetSolution.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class VNetSolution partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolution DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new VNetSolution(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolution DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new VNetSolution(content); } @@ -85,15 +93,27 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolution FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -108,17 +128,17 @@ internal VNetSolution(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolutionInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolutionInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolutionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolutionInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("DeleteOrUpdateBehavior")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolutionInternal)this).DeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolutionInternal)this).DeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolutionInternal)this).DeleteOrUpdateBehavior = (string) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolutionInternal)this).DeleteOrUpdateBehavior, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -133,11 +153,11 @@ internal VNetSolution(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolutionInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolutionInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolutionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolutionInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("DeleteOrUpdateBehavior")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolutionInternal)this).DeleteOrUpdateBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior?) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolutionInternal)this).DeleteOrUpdateBehavior, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolutionInternal)this).DeleteOrUpdateBehavior = (string) content.GetValueForProperty("DeleteOrUpdateBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolutionInternal)this).DeleteOrUpdateBehavior, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/VNetSolution.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/VNetSolution.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/VNetSolution.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/VNetSolution.TypeConverter.cs index b232703e6f5d..855bb8d4039a 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/VNetSolution.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/VNetSolution.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolution ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolution).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/VNetSolution.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/VNetSolution.cs similarity index 65% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/VNetSolution.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/VNetSolution.cs index 3717df32d991..87f49769d2da 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/VNetSolution.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/VNetSolution.cs @@ -3,31 +3,31 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The VNet solution for linker public partial class VNetSolution : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolution, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolutionInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolutionInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? _deleteOrUpdateBehavior; + private string _deleteOrUpdateBehavior; /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get => this._deleteOrUpdateBehavior; set => this._deleteOrUpdateBehavior = value; } + public string DeleteOrUpdateBehavior { get => this._deleteOrUpdateBehavior; set => this._deleteOrUpdateBehavior = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType? _type; + private string _type; /// Type of VNet solution. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType? Type { get => this._type; set => this._type = value; } + public string Type { get => this._type; set => this._type = value; } /// Creates an new instance. public VNetSolution() @@ -45,18 +45,26 @@ public partial interface IVNetSolution : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether to clean up previous operation when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string DeleteOrUpdateBehavior { get; set; } /// Type of VNet solution. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of VNet solution.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType? Type { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] + string Type { get; set; } } /// The VNet solution for linker @@ -66,9 +74,11 @@ internal partial interface IVNetSolutionInternal /// /// Indicates whether to clean up previous operation when Linker is updating or deleting /// - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior? DeleteOrUpdateBehavior { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + string DeleteOrUpdateBehavior { get; set; } /// Type of VNet solution. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType? Type { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] + string Type { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/VNetSolution.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/VNetSolution.json.cs similarity index 94% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/VNetSolution.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/VNetSolution.json.cs index d46422d3d949..920aa43b547d 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/VNetSolution.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/VNetSolution.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class VNetSolution partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolution. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolution. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IVNetSolution FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IVNetSolution FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new VNetSolution(json) : null; } @@ -102,8 +102,8 @@ internal VNetSolution(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.J { return; } - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_deleteOrUpdateBehavior = If( json?.PropertyT("deleteOrUpdateBehavior"), out var __jsonDeleteOrUpdateBehavior) ? (string)__jsonDeleteOrUpdateBehavior : (string)DeleteOrUpdateBehavior;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_deleteOrUpdateBehavior = If( json?.PropertyT("deleteOrUpdateBehavior"), out var __jsonDeleteOrUpdateBehavior) ? (string)__jsonDeleteOrUpdateBehavior : (string)_deleteOrUpdateBehavior;} AfterFromJson(json); } } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidateOperationResult.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidateOperationResult.PowerShell.cs similarity index 51% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidateOperationResult.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidateOperationResult.PowerShell.cs index e8d00fcb51ef..c9915eb26996 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidateOperationResult.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidateOperationResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ValidateOperationResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ValidateOperationResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ValidateOperationResult(content); } @@ -87,15 +93,27 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -110,53 +128,53 @@ internal ValidateOperationResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ValidateResultTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ValidateResultTypeConverter.ConvertFrom); } if (content.Contains("ResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).ResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).ResourceId, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).Status, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("AuthType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType?) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).AuthType = (string) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).AuthType, global::System.Convert.ToString); } if (content.Contains("LinkerName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).LinkerName = (string) content.GetValueForProperty("LinkerName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).LinkerName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).LinkerName = (string) content.GetValueForProperty("LinkerName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).LinkerName, global::System.Convert.ToString); } if (content.Contains("IsConnectionAvailable")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).IsConnectionAvailable = (bool?) content.GetValueForProperty("IsConnectionAvailable",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).IsConnectionAvailable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).IsConnectionAvailable = (bool?) content.GetValueForProperty("IsConnectionAvailable",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).IsConnectionAvailable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ReportStartTimeUtc")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).ReportStartTimeUtc = (global::System.DateTime?) content.GetValueForProperty("ReportStartTimeUtc",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).ReportStartTimeUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).ReportStartTimeUtc = (global::System.DateTime?) content.GetValueForProperty("ReportStartTimeUtc",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).ReportStartTimeUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("ReportEndTimeUtc")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).ReportEndTimeUtc = (global::System.DateTime?) content.GetValueForProperty("ReportEndTimeUtc",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).ReportEndTimeUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).ReportEndTimeUtc = (global::System.DateTime?) content.GetValueForProperty("ReportEndTimeUtc",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).ReportEndTimeUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("SourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).SourceId = (string) content.GetValueForProperty("SourceId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).SourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).SourceId = (string) content.GetValueForProperty("SourceId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).SourceId, global::System.Convert.ToString); } if (content.Contains("TargetId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).TargetId = (string) content.GetValueForProperty("TargetId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).TargetId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).TargetId = (string) content.GetValueForProperty("TargetId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).TargetId, global::System.Convert.ToString); } if (content.Contains("ValidationDetail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).ValidationDetail = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItem[]) content.GetValueForProperty("ValidationDetail",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).ValidationDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ValidationResultItemTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).ValidationDetail = (System.Collections.Generic.List) content.GetValueForProperty("ValidationDetail",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).ValidationDetail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ValidationResultItemTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -171,47 +189,47 @@ internal ValidateOperationResult(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ValidateResultTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ValidateResultTypeConverter.ConvertFrom); } if (content.Contains("ResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).ResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).ResourceId, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).Status, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("AuthType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType?) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).AuthType = (string) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).AuthType, global::System.Convert.ToString); } if (content.Contains("LinkerName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).LinkerName = (string) content.GetValueForProperty("LinkerName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).LinkerName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).LinkerName = (string) content.GetValueForProperty("LinkerName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).LinkerName, global::System.Convert.ToString); } if (content.Contains("IsConnectionAvailable")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).IsConnectionAvailable = (bool?) content.GetValueForProperty("IsConnectionAvailable",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).IsConnectionAvailable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).IsConnectionAvailable = (bool?) content.GetValueForProperty("IsConnectionAvailable",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).IsConnectionAvailable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ReportStartTimeUtc")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).ReportStartTimeUtc = (global::System.DateTime?) content.GetValueForProperty("ReportStartTimeUtc",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).ReportStartTimeUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).ReportStartTimeUtc = (global::System.DateTime?) content.GetValueForProperty("ReportStartTimeUtc",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).ReportStartTimeUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("ReportEndTimeUtc")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).ReportEndTimeUtc = (global::System.DateTime?) content.GetValueForProperty("ReportEndTimeUtc",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).ReportEndTimeUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).ReportEndTimeUtc = (global::System.DateTime?) content.GetValueForProperty("ReportEndTimeUtc",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).ReportEndTimeUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("SourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).SourceId = (string) content.GetValueForProperty("SourceId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).SourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).SourceId = (string) content.GetValueForProperty("SourceId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).SourceId, global::System.Convert.ToString); } if (content.Contains("TargetId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).TargetId = (string) content.GetValueForProperty("TargetId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).TargetId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).TargetId = (string) content.GetValueForProperty("TargetId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).TargetId, global::System.Convert.ToString); } if (content.Contains("ValidationDetail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).ValidationDetail = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItem[]) content.GetValueForProperty("ValidationDetail",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal)this).ValidationDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ValidationResultItemTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).ValidationDetail = (System.Collections.Generic.List) content.GetValueForProperty("ValidationDetail",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal)this).ValidationDetail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ValidationResultItemTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidateOperationResult.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidateOperationResult.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidateOperationResult.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidateOperationResult.TypeConverter.cs index 08707e2d644b..21a2d4b21037 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidateOperationResult.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidateOperationResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidateOperationResult.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidateOperationResult.cs similarity index 68% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidateOperationResult.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidateOperationResult.cs index 4c3682c97e04..fe9f8a1efc56 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidateOperationResult.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidateOperationResult.cs @@ -3,45 +3,45 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The validation operation result for a Linker. public partial class ValidateOperationResult : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResult, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResult, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal { /// The authentication type. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType? AuthType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)Property).AuthType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)Property).AuthType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType)""); } + public string AuthType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)Property).AuthType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)Property).AuthType = value ?? null; } /// A boolean value indicating whether the connection is available or not [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public bool? IsConnectionAvailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)Property).IsConnectionAvailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)Property).IsConnectionAvailable = value ?? default(bool); } + public bool? IsConnectionAvailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)Property).IsConnectionAvailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)Property).IsConnectionAvailable = value ?? default(bool); } /// The linker name. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string LinkerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)Property).LinkerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)Property).LinkerName = value ?? null; } + public string LinkerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)Property).LinkerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)Property).LinkerName = value ?? null; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResultInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ValidateResult()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResultInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ValidateResult()); set { {_property = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult _property; + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult _property; /// The validation result detail. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ValidateResult()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ValidateResult()); set => this._property = value; } /// The end time of the validation report. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public global::System.DateTime? ReportEndTimeUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)Property).ReportEndTimeUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)Property).ReportEndTimeUtc = value ?? default(global::System.DateTime); } + public global::System.DateTime? ReportEndTimeUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)Property).ReportEndTimeUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)Property).ReportEndTimeUtc = value ?? default(global::System.DateTime); } /// The start time of the validation report. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public global::System.DateTime? ReportStartTimeUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)Property).ReportStartTimeUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)Property).ReportStartTimeUtc = value ?? default(global::System.DateTime); } + public global::System.DateTime? ReportStartTimeUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)Property).ReportStartTimeUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)Property).ReportStartTimeUtc = value ?? default(global::System.DateTime); } /// Backing field for property. private string _resourceId; @@ -52,7 +52,7 @@ public partial class ValidateOperationResult : /// The resource id of the Linker source application. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string SourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)Property).SourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)Property).SourceId = value ?? null; } + public string SourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)Property).SourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)Property).SourceId = value ?? null; } /// Backing field for property. private string _status; @@ -63,11 +63,11 @@ public partial class ValidateOperationResult : /// The resource Id of target service. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public string TargetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)Property).TargetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)Property).TargetId = value ?? null; } + public string TargetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)Property).TargetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)Property).TargetId = value ?? null; } /// The detail of validation result [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItem[] ValidationDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)Property).ValidationDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)Property).ValidationDetail = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ValidationDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)Property).ValidationDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)Property).ValidationDetail = value ?? null /* arrayOf */; } /// Creates an new instance. public ValidateOperationResult() @@ -83,14 +83,21 @@ public partial interface IValidateOperationResult : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The authentication type.", SerializedName = @"authType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType? AuthType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("systemAssignedIdentity", "userAssignedIdentity", "servicePrincipalSecret", "servicePrincipalCertificate", "secret", "accessKey", "userAccount")] + string AuthType { get; set; } /// A boolean value indicating whether the connection is available or not [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A boolean value indicating whether the connection is available or not", SerializedName = @"isConnectionAvailable", PossibleTypes = new [] { typeof(bool) })] @@ -99,6 +106,9 @@ public partial interface IValidateOperationResult : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The linker name.", SerializedName = @"linkerName", PossibleTypes = new [] { typeof(string) })] @@ -107,6 +117,9 @@ public partial interface IValidateOperationResult : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The end time of the validation report.", SerializedName = @"reportEndTimeUtc", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -115,6 +128,9 @@ public partial interface IValidateOperationResult : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The start time of the validation report.", SerializedName = @"reportStartTimeUtc", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -123,6 +139,9 @@ public partial interface IValidateOperationResult : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Validated Linker id.", SerializedName = @"resourceId", PossibleTypes = new [] { typeof(string) })] @@ -131,6 +150,9 @@ public partial interface IValidateOperationResult : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource id of the Linker source application.", SerializedName = @"sourceId", PossibleTypes = new [] { typeof(string) })] @@ -139,6 +161,9 @@ public partial interface IValidateOperationResult : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Validation operation status.", SerializedName = @"status", PossibleTypes = new [] { typeof(string) })] @@ -147,6 +172,9 @@ public partial interface IValidateOperationResult : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource Id of target service.", SerializedName = @"targetId", PossibleTypes = new [] { typeof(string) })] @@ -155,10 +183,13 @@ public partial interface IValidateOperationResult : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The detail of validation result", SerializedName = @"validationDetail", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItem) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItem[] ValidationDetail { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItem) })] + System.Collections.Generic.List ValidationDetail { get; set; } } /// The validation operation result for a Linker. @@ -166,13 +197,14 @@ internal partial interface IValidateOperationResultInternal { /// The authentication type. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType? AuthType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("systemAssignedIdentity", "userAssignedIdentity", "servicePrincipalSecret", "servicePrincipalCertificate", "secret", "accessKey", "userAccount")] + string AuthType { get; set; } /// A boolean value indicating whether the connection is available or not bool? IsConnectionAvailable { get; set; } /// The linker name. string LinkerName { get; set; } /// The validation result detail. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult Property { get; set; } /// The end time of the validation report. global::System.DateTime? ReportEndTimeUtc { get; set; } /// The start time of the validation report. @@ -186,7 +218,7 @@ internal partial interface IValidateOperationResultInternal /// The resource Id of target service. string TargetId { get; set; } /// The detail of validation result - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItem[] ValidationDetail { get; set; } + System.Collections.Generic.List ValidationDetail { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidateOperationResult.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidateOperationResult.json.cs similarity index 93% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidateOperationResult.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidateOperationResult.json.cs index 93db7758e6aa..6da6da205982 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidateOperationResult.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidateOperationResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ValidateOperationResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new ValidateOperationResult(json) : null; } @@ -103,9 +103,9 @@ internal ValidateOperationResult(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinke { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ValidateResult.FromJson(__jsonProperties) : Property;} - {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ValidateResult.FromJson(__jsonProperties) : _property;} + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)_resourceId;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} AfterFromJson(json); } } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidateResult.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidateResult.PowerShell.cs similarity index 56% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidateResult.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidateResult.PowerShell.cs index 7bdfde774dfa..1a27bff7627b 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidateResult.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidateResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ValidateResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ValidateResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ValidateResult(content); } @@ -87,15 +93,27 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -110,41 +128,41 @@ internal ValidateResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("LinkerName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).LinkerName = (string) content.GetValueForProperty("LinkerName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).LinkerName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).LinkerName = (string) content.GetValueForProperty("LinkerName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).LinkerName, global::System.Convert.ToString); } if (content.Contains("IsConnectionAvailable")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).IsConnectionAvailable = (bool?) content.GetValueForProperty("IsConnectionAvailable",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).IsConnectionAvailable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).IsConnectionAvailable = (bool?) content.GetValueForProperty("IsConnectionAvailable",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).IsConnectionAvailable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ReportStartTimeUtc")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).ReportStartTimeUtc = (global::System.DateTime?) content.GetValueForProperty("ReportStartTimeUtc",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).ReportStartTimeUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).ReportStartTimeUtc = (global::System.DateTime?) content.GetValueForProperty("ReportStartTimeUtc",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).ReportStartTimeUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("ReportEndTimeUtc")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).ReportEndTimeUtc = (global::System.DateTime?) content.GetValueForProperty("ReportEndTimeUtc",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).ReportEndTimeUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).ReportEndTimeUtc = (global::System.DateTime?) content.GetValueForProperty("ReportEndTimeUtc",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).ReportEndTimeUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("SourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).SourceId = (string) content.GetValueForProperty("SourceId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).SourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).SourceId = (string) content.GetValueForProperty("SourceId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).SourceId, global::System.Convert.ToString); } if (content.Contains("TargetId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).TargetId = (string) content.GetValueForProperty("TargetId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).TargetId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).TargetId = (string) content.GetValueForProperty("TargetId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).TargetId, global::System.Convert.ToString); } if (content.Contains("AuthType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType?) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).AuthType = (string) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).AuthType, global::System.Convert.ToString); } if (content.Contains("ValidationDetail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).ValidationDetail = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItem[]) content.GetValueForProperty("ValidationDetail",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).ValidationDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ValidationResultItemTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).ValidationDetail = (System.Collections.Generic.List) content.GetValueForProperty("ValidationDetail",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).ValidationDetail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ValidationResultItemTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -159,35 +177,35 @@ internal ValidateResult(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("LinkerName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).LinkerName = (string) content.GetValueForProperty("LinkerName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).LinkerName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).LinkerName = (string) content.GetValueForProperty("LinkerName",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).LinkerName, global::System.Convert.ToString); } if (content.Contains("IsConnectionAvailable")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).IsConnectionAvailable = (bool?) content.GetValueForProperty("IsConnectionAvailable",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).IsConnectionAvailable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).IsConnectionAvailable = (bool?) content.GetValueForProperty("IsConnectionAvailable",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).IsConnectionAvailable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ReportStartTimeUtc")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).ReportStartTimeUtc = (global::System.DateTime?) content.GetValueForProperty("ReportStartTimeUtc",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).ReportStartTimeUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).ReportStartTimeUtc = (global::System.DateTime?) content.GetValueForProperty("ReportStartTimeUtc",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).ReportStartTimeUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("ReportEndTimeUtc")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).ReportEndTimeUtc = (global::System.DateTime?) content.GetValueForProperty("ReportEndTimeUtc",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).ReportEndTimeUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).ReportEndTimeUtc = (global::System.DateTime?) content.GetValueForProperty("ReportEndTimeUtc",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).ReportEndTimeUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("SourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).SourceId = (string) content.GetValueForProperty("SourceId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).SourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).SourceId = (string) content.GetValueForProperty("SourceId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).SourceId, global::System.Convert.ToString); } if (content.Contains("TargetId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).TargetId = (string) content.GetValueForProperty("TargetId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).TargetId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).TargetId = (string) content.GetValueForProperty("TargetId",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).TargetId, global::System.Convert.ToString); } if (content.Contains("AuthType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType?) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).AuthType = (string) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).AuthType, global::System.Convert.ToString); } if (content.Contains("ValidationDetail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).ValidationDetail = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItem[]) content.GetValueForProperty("ValidationDetail",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal)this).ValidationDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ValidationResultItemTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).ValidationDetail = (System.Collections.Generic.List) content.GetValueForProperty("ValidationDetail",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal)this).ValidationDetail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ValidationResultItemTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidateResult.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidateResult.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidateResult.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidateResult.TypeConverter.cs index 3da507a88208..08580fcd8d85 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidateResult.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidateResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidateResult.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidateResult.cs similarity index 80% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidateResult.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidateResult.cs index 3b5498fd9129..ff1b2ab99898 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidateResult.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidateResult.cs @@ -3,22 +3,22 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The validation result for a Linker. public partial class ValidateResult : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResultInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResultInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType? _authType; + private string _authType; /// The authentication type. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType? AuthType { get => this._authType; set => this._authType = value; } + public string AuthType { get => this._authType; set => this._authType = value; } /// Backing field for property. private bool? _isConnectionAvailable; @@ -63,11 +63,11 @@ public partial class ValidateResult : public string TargetId { get => this._targetId; set => this._targetId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItem[] _validationDetail; + private System.Collections.Generic.List _validationDetail; /// The detail of validation result [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItem[] ValidationDetail { get => this._validationDetail; set => this._validationDetail = value; } + public System.Collections.Generic.List ValidationDetail { get => this._validationDetail; set => this._validationDetail = value; } /// Creates an new instance. public ValidateResult() @@ -83,14 +83,21 @@ public partial interface IValidateResult : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The authentication type.", SerializedName = @"authType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType? AuthType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("systemAssignedIdentity", "userAssignedIdentity", "servicePrincipalSecret", "servicePrincipalCertificate", "secret", "accessKey", "userAccount")] + string AuthType { get; set; } /// A boolean value indicating whether the connection is available or not [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A boolean value indicating whether the connection is available or not", SerializedName = @"isConnectionAvailable", PossibleTypes = new [] { typeof(bool) })] @@ -99,6 +106,9 @@ public partial interface IValidateResult : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The linker name.", SerializedName = @"linkerName", PossibleTypes = new [] { typeof(string) })] @@ -107,6 +117,9 @@ public partial interface IValidateResult : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The end time of the validation report.", SerializedName = @"reportEndTimeUtc", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -115,6 +128,9 @@ public partial interface IValidateResult : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The start time of the validation report.", SerializedName = @"reportStartTimeUtc", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -123,6 +139,9 @@ public partial interface IValidateResult : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource id of the Linker source application.", SerializedName = @"sourceId", PossibleTypes = new [] { typeof(string) })] @@ -131,6 +150,9 @@ public partial interface IValidateResult : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource Id of target service.", SerializedName = @"targetId", PossibleTypes = new [] { typeof(string) })] @@ -139,10 +161,13 @@ public partial interface IValidateResult : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The detail of validation result", SerializedName = @"validationDetail", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItem) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItem[] ValidationDetail { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItem) })] + System.Collections.Generic.List ValidationDetail { get; set; } } /// The validation result for a Linker. @@ -150,7 +175,8 @@ internal partial interface IValidateResultInternal { /// The authentication type. - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType? AuthType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("systemAssignedIdentity", "userAssignedIdentity", "servicePrincipalSecret", "servicePrincipalCertificate", "secret", "accessKey", "userAccount")] + string AuthType { get; set; } /// A boolean value indicating whether the connection is available or not bool? IsConnectionAvailable { get; set; } /// The linker name. @@ -164,7 +190,7 @@ internal partial interface IValidateResultInternal /// The resource Id of target service. string TargetId { get; set; } /// The detail of validation result - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItem[] ValidationDetail { get; set; } + System.Collections.Generic.List ValidationDetail { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidateResult.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidateResult.json.cs similarity index 90% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidateResult.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidateResult.json.cs index cb948e60cdcd..a53740f126bb 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidateResult.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidateResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ValidateResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new ValidateResult(json) : null; } @@ -116,14 +116,14 @@ internal ValidateResult(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime { return; } - {_linkerName = If( json?.PropertyT("linkerName"), out var __jsonLinkerName) ? (string)__jsonLinkerName : (string)LinkerName;} - {_isConnectionAvailable = If( json?.PropertyT("isConnectionAvailable"), out var __jsonIsConnectionAvailable) ? (bool?)__jsonIsConnectionAvailable : IsConnectionAvailable;} - {_reportStartTimeUtc = If( json?.PropertyT("reportStartTimeUtc"), out var __jsonReportStartTimeUtc) ? global::System.DateTime.TryParse((string)__jsonReportStartTimeUtc, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonReportStartTimeUtcValue) ? __jsonReportStartTimeUtcValue : ReportStartTimeUtc : ReportStartTimeUtc;} - {_reportEndTimeUtc = If( json?.PropertyT("reportEndTimeUtc"), out var __jsonReportEndTimeUtc) ? global::System.DateTime.TryParse((string)__jsonReportEndTimeUtc, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonReportEndTimeUtcValue) ? __jsonReportEndTimeUtcValue : ReportEndTimeUtc : ReportEndTimeUtc;} - {_sourceId = If( json?.PropertyT("sourceId"), out var __jsonSourceId) ? (string)__jsonSourceId : (string)SourceId;} - {_targetId = If( json?.PropertyT("targetId"), out var __jsonTargetId) ? (string)__jsonTargetId : (string)TargetId;} - {_authType = If( json?.PropertyT("authType"), out var __jsonAuthType) ? (string)__jsonAuthType : (string)AuthType;} - {_validationDetail = If( json?.PropertyT("validationDetail"), out var __jsonValidationDetail) ? If( __jsonValidationDetail as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Models.Api20221101Preview.IValidationResultItem) (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ValidationResultItem.FromJson(__u) )) ))() : null : ValidationDetail;} + {_linkerName = If( json?.PropertyT("linkerName"), out var __jsonLinkerName) ? (string)__jsonLinkerName : (string)_linkerName;} + {_isConnectionAvailable = If( json?.PropertyT("isConnectionAvailable"), out var __jsonIsConnectionAvailable) ? (bool?)__jsonIsConnectionAvailable : _isConnectionAvailable;} + {_reportStartTimeUtc = If( json?.PropertyT("reportStartTimeUtc"), out var __jsonReportStartTimeUtc) ? global::System.DateTime.TryParse((string)__jsonReportStartTimeUtc, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonReportStartTimeUtcValue) ? __jsonReportStartTimeUtcValue : _reportStartTimeUtc : _reportStartTimeUtc;} + {_reportEndTimeUtc = If( json?.PropertyT("reportEndTimeUtc"), out var __jsonReportEndTimeUtc) ? global::System.DateTime.TryParse((string)__jsonReportEndTimeUtc, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonReportEndTimeUtcValue) ? __jsonReportEndTimeUtcValue : _reportEndTimeUtc : _reportEndTimeUtc;} + {_sourceId = If( json?.PropertyT("sourceId"), out var __jsonSourceId) ? (string)__jsonSourceId : (string)_sourceId;} + {_targetId = If( json?.PropertyT("targetId"), out var __jsonTargetId) ? (string)__jsonTargetId : (string)_targetId;} + {_authType = If( json?.PropertyT("authType"), out var __jsonAuthType) ? (string)__jsonAuthType : (string)_authType;} + {_validationDetail = If( json?.PropertyT("validationDetail"), out var __jsonValidationDetail) ? If( __jsonValidationDetail as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItem) (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ValidationResultItem.FromJson(__u) )) ))() : null : _validationDetail;} AfterFromJson(json); } } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidationResultItem.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidationResultItem.PowerShell.cs similarity index 66% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidationResultItem.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidationResultItem.PowerShell.cs index e57d7146f1dc..6d2f2d17c546 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidationResultItem.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidationResultItem.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ValidationResultItem partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItem DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ValidationResultItem(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ValidationResultItem(content); } @@ -87,15 +93,27 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -110,29 +128,29 @@ internal ValidationResultItem(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItemInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItemInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItemInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItemInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItemInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItemInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItemInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItemInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("Result")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItemInternal)this).Result = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ValidationResultStatus?) content.GetValueForProperty("Result",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItemInternal)this).Result, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ValidationResultStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItemInternal)this).Result = (string) content.GetValueForProperty("Result",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItemInternal)this).Result, global::System.Convert.ToString); } if (content.Contains("ErrorMessage")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItemInternal)this).ErrorMessage = (string) content.GetValueForProperty("ErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItemInternal)this).ErrorMessage, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItemInternal)this).ErrorMessage = (string) content.GetValueForProperty("ErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItemInternal)this).ErrorMessage, global::System.Convert.ToString); } if (content.Contains("ErrorCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItemInternal)this).ErrorCode = (string) content.GetValueForProperty("ErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItemInternal)this).ErrorCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItemInternal)this).ErrorCode = (string) content.GetValueForProperty("ErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItemInternal)this).ErrorCode, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -147,23 +165,23 @@ internal ValidationResultItem(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItemInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItemInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItemInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItemInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItemInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItemInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItemInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItemInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("Result")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItemInternal)this).Result = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ValidationResultStatus?) content.GetValueForProperty("Result",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItemInternal)this).Result, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ValidationResultStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItemInternal)this).Result = (string) content.GetValueForProperty("Result",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItemInternal)this).Result, global::System.Convert.ToString); } if (content.Contains("ErrorMessage")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItemInternal)this).ErrorMessage = (string) content.GetValueForProperty("ErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItemInternal)this).ErrorMessage, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItemInternal)this).ErrorMessage = (string) content.GetValueForProperty("ErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItemInternal)this).ErrorMessage, global::System.Convert.ToString); } if (content.Contains("ErrorCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItemInternal)this).ErrorCode = (string) content.GetValueForProperty("ErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItemInternal)this).ErrorCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItemInternal)this).ErrorCode = (string) content.GetValueForProperty("ErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItemInternal)this).ErrorCode, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidationResultItem.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidationResultItem.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidationResultItem.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidationResultItem.TypeConverter.cs index 2f80ea58a623..71fc7e02be82 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidationResultItem.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidationResultItem.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItem ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItem ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItem).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItem).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidationResultItem.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidationResultItem.cs similarity index 85% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidationResultItem.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidationResultItem.cs index 9f4f57a12693..031bef48be12 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidationResultItem.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidationResultItem.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; /// The validation item for a Linker. public partial class ValidationResultItem : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItem, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItemInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItem, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItemInternal { /// Backing field for property. @@ -42,11 +42,11 @@ public partial class ValidationResultItem : public string Name { get => this._name; set => this._name = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ValidationResultStatus? _result; + private string _result; /// The result of validation [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ValidationResultStatus? Result { get => this._result; set => this._result = value; } + public string Result { get => this._result; set => this._result = value; } /// Creates an new instance. public ValidationResultItem() @@ -62,6 +62,9 @@ public partial interface IValidationResultItem : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The display name of validation item", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -70,6 +73,9 @@ public partial interface IValidationResultItem : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The error code of validation result", SerializedName = @"errorCode", PossibleTypes = new [] { typeof(string) })] @@ -78,6 +84,9 @@ public partial interface IValidationResultItem : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The error message of validation result", SerializedName = @"errorMessage", PossibleTypes = new [] { typeof(string) })] @@ -86,6 +95,9 @@ public partial interface IValidationResultItem : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The validation item name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -94,10 +106,14 @@ public partial interface IValidationResultItem : [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The result of validation", SerializedName = @"result", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ValidationResultStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ValidationResultStatus? Result { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("success", "failure", "warning")] + string Result { get; set; } } /// The validation item for a Linker. @@ -113,7 +129,8 @@ internal partial interface IValidationResultItemInternal /// The validation item name. string Name { get; set; } /// The result of validation - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ValidationResultStatus? Result { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("success", "failure", "warning")] + string Result { get; set; } } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidationResultItem.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidationResultItem.json.cs similarity index 94% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidationResultItem.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidationResultItem.json.cs index 7203a80e7214..d7b29c10eaf1 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValidationResultItem.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValidationResultItem.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ValidationResultItem partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItem. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItem. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItem. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItem. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidationResultItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidationResultItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new ValidationResultItem(json) : null; } @@ -105,11 +105,11 @@ internal ValidationResultItem(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.R { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_result = If( json?.PropertyT("result"), out var __jsonResult) ? (string)__jsonResult : (string)Result;} - {_errorMessage = If( json?.PropertyT("errorMessage"), out var __jsonErrorMessage) ? (string)__jsonErrorMessage : (string)ErrorMessage;} - {_errorCode = If( json?.PropertyT("errorCode"), out var __jsonErrorCode) ? (string)__jsonErrorCode : (string)ErrorCode;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_result = If( json?.PropertyT("result"), out var __jsonResult) ? (string)__jsonResult : (string)_result;} + {_errorMessage = If( json?.PropertyT("errorMessage"), out var __jsonErrorMessage) ? (string)__jsonErrorMessage : (string)_errorMessage;} + {_errorCode = If( json?.PropertyT("errorCode"), out var __jsonErrorCode) ? (string)__jsonErrorCode : (string)_errorCode;} AfterFromJson(json); } } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValueSecretInfo.PowerShell.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValueSecretInfo.PowerShell.cs similarity index 75% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValueSecretInfo.PowerShell.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValueSecretInfo.PowerShell.cs index 5034098ddad7..4ed2f2fd574e 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValueSecretInfo.PowerShell.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValueSecretInfo.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -57,29 +57,35 @@ public partial class ValueSecretInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValueSecretInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValueSecretInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ValueSecretInfo(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValueSecretInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValueSecretInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ValueSecretInfo(content); } @@ -89,15 +95,27 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api2022110 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValueSecretInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValueSecretInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeAll)?.ToString(); + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -112,17 +130,17 @@ internal ValueSecretInfo(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValueSecretInfoInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValueSecretInfoInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValueSecretInfoInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValueSecretInfoInternal)this).Value, global::System.Convert.ToString); } if (content.Contains("SecretType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBaseInternal)this).SecretType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType) content.GetValueForProperty("SecretType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBaseInternal)this).SecretType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBaseInternal)this).SecretType = (string) content.GetValueForProperty("SecretType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBaseInternal)this).SecretType, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -137,11 +155,11 @@ internal ValueSecretInfo(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValueSecretInfoInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValueSecretInfoInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValueSecretInfoInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValueSecretInfoInternal)this).Value, global::System.Convert.ToString); } if (content.Contains("SecretType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBaseInternal)this).SecretType = (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType) content.GetValueForProperty("SecretType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBaseInternal)this).SecretType, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBaseInternal)this).SecretType = (string) content.GetValueForProperty("SecretType",((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBaseInternal)this).SecretType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValueSecretInfo.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValueSecretInfo.TypeConverter.cs similarity index 97% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValueSecretInfo.TypeConverter.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValueSecretInfo.TypeConverter.cs index 3a273ac5d63e..a7437e5fe948 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValueSecretInfo.TypeConverter.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValueSecretInfo.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValueSecretInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValueSecretInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValueSecretInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValueSecretInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValueSecretInfo.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValueSecretInfo.cs similarity index 81% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValueSecretInfo.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValueSecretInfo.cs index 30a2e09a1d45..ae550c3f64c4 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValueSecretInfo.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValueSecretInfo.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -11,19 +11,20 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Pre /// The secret info when type is rawValue. It's for scenarios that user input the secret. /// public partial class ValueSecretInfo : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValueSecretInfo, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValueSecretInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValueSecretInfo, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValueSecretInfoInternal, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBase __secretInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretInfoBase(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBase __secretInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretInfoBase(); /// The secret type. + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Constant] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Origin(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType SecretType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBaseInternal)__secretInfoBase).SecretType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBaseInternal)__secretInfoBase).SecretType = value ; } + public string SecretType { get => "rawValue"; set => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBaseInternal)__secretInfoBase).SecretType = "rawValue"; } /// Backing field for property. private string _value; @@ -47,18 +48,21 @@ public partial class ValueSecretInfo : /// Creates an new instance. public ValueSecretInfo() { - + this.__secretInfoBase.SecretType = "rawValue"; } } /// The secret info when type is rawValue. It's for scenarios that user input the secret. public partial interface IValueSecretInfo : Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBase + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBase { /// The actual value of the secret. [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The actual value of the secret.", SerializedName = @"value", PossibleTypes = new [] { typeof(string) })] @@ -67,7 +71,7 @@ public partial interface IValueSecretInfo : } /// The secret info when type is rawValue. It's for scenarios that user input the secret. internal partial interface IValueSecretInfoInternal : - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISecretInfoBaseInternal + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ISecretInfoBaseInternal { /// The actual value of the secret. string Value { get; set; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValueSecretInfo.json.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValueSecretInfo.json.cs similarity index 94% rename from generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValueSecretInfo.json.cs rename to generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValueSecretInfo.json.cs index c8d5746531d9..ed9d5f4db848 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/Api20221101Preview/ValueSecretInfo.json.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Models/ValueSecretInfo.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class ValueSecretInfo partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValueSecretInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValueSecretInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValueSecretInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValueSecretInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValueSecretInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValueSecretInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json ? new ValueSecretInfo(json) : null; } @@ -104,8 +104,8 @@ internal ValueSecretInfo(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtim { return; } - __secretInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.SecretInfoBase(json); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + __secretInfoBase = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.SecretInfoBase(json); + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)_value;} AfterFromJson(json); } } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/ServiceLinker.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/ServiceLinker.cs index ec906d8e4f73..648274a641a4 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/ServiceLinker.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/ServiceLinker.cs @@ -27,7 +27,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConfigurationNamesList(string Filter, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConfigurationNamesList(string Filter, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -53,7 +53,7 @@ public partial class ServiceLinker await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ConfigurationNamesList_Call(request,onOk,onDefault,eventListener,sender); + await this.ConfigurationNamesList_Call (request, onOk,onDefault,eventListener,sender); } } @@ -71,7 +71,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConfigurationNamesListViaIdentity(global::System.String viaIdentity, string Filter, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConfigurationNamesListViaIdentity(global::System.String viaIdentity, string Filter, string SkipToken, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -106,11 +106,163 @@ public partial class ServiceLinker await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ConfigurationNamesList_Call(request,onOk,onDefault,eventListener,sender); + await this.ConfigurationNamesList_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// + /// Lists the configuration names generated by Service Connector for all target, client types, auth types. + /// + /// + /// OData filter options. + /// OData skipToken option for pagination. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConfigurationNamesListViaIdentityWithResult(global::System.String viaIdentity, string Filter, string SkipToken, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.ServiceLinker/configurationNames$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.ServiceLinker/configurationNames'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.ServiceLinker/configurationNames" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(SkipToken) ? global::System.String.Empty : "$skipToken=" + global::System.Uri.EscapeDataString(SkipToken)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConfigurationNamesListWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Lists the configuration names generated by Service Connector for all target, client types, auth types. + /// + /// OData filter options. + /// OData skipToken option for pagination. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConfigurationNamesListWithResult(string Filter, string SkipToken, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.ServiceLinker/configurationNames" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(SkipToken) ? global::System.String.Empty : "$skipToken=" + global::System.Uri.EscapeDataString(SkipToken)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConfigurationNamesListWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConfigurationNamesListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationNameResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -120,7 +272,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ConfigurationNamesList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ConfigurationNamesList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -131,6 +283,7 @@ public partial class ServiceLinker await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -138,13 +291,13 @@ public partial class ServiceLinker case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationNameResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationNameResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -189,10 +342,11 @@ public partial class ServiceLinker /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConnectorCreateDryrun(string subscriptionId, string resourceGroupName, string location, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorCreateDryrun(string subscriptionId, string resourceGroupName, string location, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -221,11 +375,11 @@ public partial class ServiceLinker await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ConnectorCreateDryrun_Call(request,onOk,onDefault,eventListener,sender); + await this.ConnectorCreateDryrun_Call (request, onOk,onDefault,eventListener,sender); } } @@ -237,10 +391,11 @@ public partial class ServiceLinker /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConnectorCreateDryrunViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorCreateDryrunViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -282,204 +437,138 @@ public partial class ServiceLinker await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ConnectorCreateDryrun_Call(request,onOk,onDefault,eventListener,sender); + await this.ConnectorCreateDryrun_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). + /// create a dryrun job to do necessary check before actual creation + /// + /// dryrun resource. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ConnectorCreateDryrun_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorCreateDryrunViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.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.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // verify that Identity format is an exact match for uri - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.UndeclaredResponseException(_response); - } - } + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.ServiceLinker/locations/(?[^/]+)/dryruns/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName}'"); + } - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var location = _match.Groups["location"].Value; + var dryrunName = _match.Groups["dryrunName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.ServiceLinker/locations/" + + location + + "/dryruns/" + + dryrunName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConnectorCreateDryrunWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// + /// create a dryrun job to do necessary check before actual creation /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of Azure region. /// The name of dryrun. - /// dryrun resource. + /// Json string supplied to the ConnectorCreateDryrun 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.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ConnectorCreateDryrun_Validate(string subscriptionId, string resourceGroupName, string location, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task ConnectorCreateDryrunViaJsonString(string subscriptionId, string resourceGroupName, string location, string dryrunName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(location),location); - await eventListener.AssertMinimumLength(nameof(location),location,1); - await eventListener.AssertNotNull(nameof(dryrunName),dryrunName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourcegroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ServiceLinker/locations/" + + global::System.Uri.EscapeDataString(location) + + "/dryruns/" + + global::System.Uri.EscapeDataString(dryrunName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ConnectorCreateDryrun_Call (request, onOk,onDefault,eventListener,sender); + } } - /// Create or update Connector resource. + /// create a dryrun job to do necessary check before actual creation /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of Azure region. - /// The name of resource. - /// Connector details. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// The name of dryrun. + /// Json string supplied to the ConnectorCreateDryrun operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConnectorCreateOrUpdate(string subscriptionId, string resourceGroupName, string location, string connectorName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorCreateDryrunViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string location, string dryrunName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -493,91 +582,232 @@ public partial class ServiceLinker + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.ServiceLinker/locations/" + global::System.Uri.EscapeDataString(location) - + "/connectors/" - + global::System.Uri.EscapeDataString(connectorName) + + "/dryruns/" + + global::System.Uri.EscapeDataString(dryrunName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ConnectorCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.ConnectorCreateDryrunWithResult_Call (request, eventListener,sender); } } - /// Create or update Connector resource. - /// - /// Connector details. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// create a dryrun job to do necessary check before actual creation + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of dryrun. + /// dryrun resource. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConnectorCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorCreateDryrunWithResult(string subscriptionId, string resourceGroupName, string location, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.ServiceLinker/locations/(?[^/]+)/connectors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var location = _match.Groups["location"].Value; - var connectorName = _match.Groups["connectorName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourcegroups/" - + resourceGroupName + + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.ServiceLinker/locations/" - + location - + "/connectors/" - + connectorName + + global::System.Uri.EscapeDataString(location) + + "/dryruns/" + + global::System.Uri.EscapeDataString(dryrunName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ConnectorCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.ConnectorCreateDryrunWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConnectorCreateDryrunWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -587,31 +817,28 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ConnectorCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ConnectorCreateDryrun_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: azure-async-operation var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -620,15 +847,14 @@ public partial class ServiceLinker if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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(); @@ -637,45 +863,45 @@ public partial class ServiceLinker _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -694,6 +920,7 @@ public partial class ServiceLinker await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -701,13 +928,13 @@ public partial class ServiceLinker case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -723,19 +950,19 @@ public partial class ServiceLinker } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of Azure region. - /// The name of resource. - /// Connector details. + /// The name of dryrun. + /// dryrun 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 ConnectorCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string location, string connectorName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ConnectorCreateDryrun_Validate(string subscriptionId, string resourceGroupName, string location, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -746,27 +973,28 @@ public partial class ServiceLinker await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(location),location); await eventListener.AssertMinimumLength(nameof(location),location,1); - await eventListener.AssertNotNull(nameof(connectorName),connectorName); + await eventListener.AssertNotNull(nameof(dryrunName),dryrunName); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Delete a Connector. + /// update Connector resource. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of Azure region. /// The name of resource. + /// Connector details. /// 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.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConnectorDelete(string subscriptionId, string resourceGroupName, string location, string connectorName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorCreateOrUpdate(string subscriptionId, string resourceGroupName, string location, string connectorName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -790,45 +1018,60 @@ public partial class ServiceLinker // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ConnectorDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.ConnectorCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// delete a dryrun job - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of Azure region. - /// The name of dryrun. + /// update Connector resource. + /// + /// Connector details. /// 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.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConnectorDeleteDryrun(string subscriptionId, string resourceGroupName, string location, string dryrunName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.ServiceLinker/locations/(?[^/]+)/connectors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var location = _match.Groups["location"].Value; + var connectorName = _match.Groups["connectorName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) + + subscriptionId + "/resourcegroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) + + resourceGroupName + "/providers/Microsoft.ServiceLinker/locations/" - + global::System.Uri.EscapeDataString(location) - + "/dryruns/" - + global::System.Uri.EscapeDataString(dryrunName) + + location + + "/connectors/" + + connectorName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -837,27 +1080,30 @@ public partial class ServiceLinker // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ConnectorDeleteDryrun_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.ConnectorCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// delete a dryrun job + /// update Connector 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). + /// Connector details. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConnectorDeleteDryrunViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -865,17 +1111,17 @@ public partial class ServiceLinker { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.ServiceLinker/locations/(?[^/]+)/dryruns/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.ServiceLinker/locations/(?[^/]+)/connectors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var location = _match.Groups["location"].Value; - var dryrunName = _match.Groups["dryrunName"].Value; + var connectorName = _match.Groups["connectorName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -884,29 +1130,36 @@ public partial class ServiceLinker + resourceGroupName + "/providers/Microsoft.ServiceLinker/locations/" + location - + "/dryruns/" - + dryrunName + + "/connectors/" + + connectorName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ConnectorDeleteDryrun_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConnectorCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. + /// update Connector resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of resource. + /// Json string supplied to the ConnectorCreateOrUpdate operation /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -914,172 +1167,172 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ConnectorDeleteDryrun_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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string location, string connectorName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourcegroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ServiceLinker/locations/" + + global::System.Uri.EscapeDataString(location) + + "/connectors/" + + global::System.Uri.EscapeDataString(connectorName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ConnectorCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// + /// update Connector resource. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of Azure region. - /// The name of dryrun. + /// The name of resource. + /// Json string supplied to the ConnectorCreateOrUpdate operation /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ConnectorDeleteDryrun_Validate(string subscriptionId, string resourceGroupName, string location, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task ConnectorCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string location, string connectorName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(location),location); - await eventListener.AssertMinimumLength(nameof(location),location,1); - await eventListener.AssertNotNull(nameof(dryrunName),dryrunName); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourcegroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ServiceLinker/locations/" + + global::System.Uri.EscapeDataString(location) + + "/connectors/" + + global::System.Uri.EscapeDataString(connectorName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConnectorCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Delete a Connector. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update Connector resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of resource. + /// Connector details. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConnectorDeleteViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string location, string connectorName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.ServiceLinker/locations/(?[^/]+)/connectors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var location = _match.Groups["location"].Value; - var connectorName = _match.Groups["connectorName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourcegroups/" - + resourceGroupName + + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.ServiceLinker/locations/" - + location + + global::System.Uri.EscapeDataString(location) + "/connectors/" - + connectorName + + global::System.Uri.EscapeDataString(connectorName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ConnectorDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.ConnectorCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ConnectorDelete_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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ConnectorCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } // declared final-state-via: azure-async-operation - var _finalUri = _response.GetFirstHeader(@"Azure-AsyncOperation"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -1088,62 +1341,61 @@ public partial class ServiceLinker if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.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.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -1152,37 +1404,44 @@ public partial class ServiceLinker } // 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.ServiceLinker.Runtime.Method.Get); + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) { case global::System.Net.HttpStatusCode.OK: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } default: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } } } @@ -1196,39 +1455,8 @@ public partial class ServiceLinker } } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of Azure region. - /// The name of 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 ConnectorDelete_Validate(string subscriptionId, string resourceGroupName, string location, string connectorName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(location),location); - await eventListener.AssertMinimumLength(nameof(location),location,1); - await eventListener.AssertNotNull(nameof(connectorName),connectorName); - } - } - - /// Generate configurations for a Connector. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of Azure region. - /// The name of resource. - /// Connection Info, including format, secret store, etc + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -1237,127 +1465,110 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConnectorGenerateConfigurations(string subscriptionId, string resourceGroupName, string location, string connectorName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) - { - var apiVersion = @"2022-11-01-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.ServiceLinker/locations/" - + global::System.Uri.EscapeDataString(location) - + "/connectors/" - + global::System.Uri.EscapeDataString(connectorName) - + "/generateConfigurations" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ConnectorGenerateConfigurations_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// Generate configurations for a Connector. - /// - /// Connection Info, including format, secret store, etc - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task ConnectorGenerateConfigurationsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) - { - var apiVersion = @"2022-11-01-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.ServiceLinker/locations/(?[^/]+)/connectors/(?[^/]+)/generateConfigurations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}/generateConfigurations'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var location = _match.Groups["location"].Value; - var connectorName = _match.Groups["connectorName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourcegroups/" - + resourceGroupName - + "/providers/Microsoft.ServiceLinker/locations/" - + location - + "/connectors/" - + connectorName - + "/generateConfigurations" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ConnectorGenerateConfigurations_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.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task ConnectorGenerateConfigurations_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ConnectorCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1365,13 +1576,13 @@ public partial class ServiceLinker case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1387,19 +1598,19 @@ public partial class ServiceLinker } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of Azure region. /// The name of resource. - /// Connection Info, including format, secret store, etc + /// Connector details. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ConnectorGenerateConfigurations_Validate(string subscriptionId, string resourceGroupName, string location, string connectorName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ConnectorCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string location, string connectorName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -1416,12 +1627,13 @@ public partial class ServiceLinker } } - /// Returns Connector resource for a given name. + /// Delete a Connector. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of Azure region. /// The name of 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. @@ -1429,7 +1641,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConnectorGet(string subscriptionId, string resourceGroupName, string location, string connectorName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorDelete(string subscriptionId, string resourceGroupName, string location, string connectorName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -1453,21 +1665,22 @@ public partial class ServiceLinker // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ConnectorGet_Call(request,onOk,onDefault,eventListener,sender); + await this.ConnectorDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// get a dryrun job + /// delete a dryrun job /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of Azure region. /// The name of dryrun. /// 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. @@ -1475,7 +1688,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConnectorGetDryrun(string subscriptionId, string resourceGroupName, string location, string dryrunName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorDeleteDryrun(string subscriptionId, string resourceGroupName, string location, string dryrunName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -1499,18 +1712,19 @@ public partial class ServiceLinker // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ConnectorGetDryrun_Call(request,onOk,onDefault,eventListener,sender); + await this.ConnectorDeleteDryrun_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// get a dryrun job + /// delete a dryrun job /// /// 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. @@ -1518,7 +1732,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConnectorGetDryrunViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorDeleteDryrunViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -1555,18 +1769,19 @@ public partial class ServiceLinker // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ConnectorGetDryrun_Call(request,onOk,onDefault,eventListener,sender); + await this.ConnectorDeleteDryrun_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -1574,7 +1789,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ConnectorGetDryrun_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ConnectorDeleteDryrun_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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1585,6 +1800,7 @@ public partial class ServiceLinker await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1592,13 +1808,19 @@ public partial class ServiceLinker case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1614,7 +1836,7 @@ public partial class ServiceLinker } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// /// The ID of the target subscription. @@ -1625,7 +1847,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ConnectorGetDryrun_Validate(string subscriptionId, string resourceGroupName, string location, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ConnectorDeleteDryrun_Validate(string subscriptionId, string resourceGroupName, string location, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -1640,9 +1862,10 @@ public partial class ServiceLinker } } - /// Returns Connector resource for a given name. + /// Delete a Connector. /// /// 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. @@ -1650,7 +1873,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConnectorGetViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorDeleteViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -1687,18 +1910,19 @@ public partial class ServiceLinker // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ConnectorGet_Call(request,onOk,onDefault,eventListener,sender); + await this.ConnectorDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -1706,17 +1930,111 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ConnectorGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ConnectorDelete_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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: azure-async-operation + var _finalUri = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.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.ServiceLinker.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.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1724,13 +2042,19 @@ public partial class ServiceLinker case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1746,7 +2070,7 @@ public partial class ServiceLinker } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// /// The ID of the target subscription. @@ -1757,7 +2081,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ConnectorGet_Validate(string subscriptionId, string resourceGroupName, string location, string connectorName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ConnectorDelete_Validate(string subscriptionId, string resourceGroupName, string location, string connectorName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -1772,22 +2096,22 @@ public partial class ServiceLinker } } - /// - /// Returns list of connector which connects to the resource, which supports to config the target service during the resource - /// provision. - /// + /// Generate configurations for a Connector. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of Azure region. + /// The name of resource. + /// Connection Info, including format, secret store, etc /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConnectorList(string subscriptionId, string resourceGroupName, string location, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorGenerateConfigurations(string subscriptionId, string resourceGroupName, string location, string connectorName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -1801,7 +2125,9 @@ public partial class ServiceLinker + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.ServiceLinker/locations/" + global::System.Uri.EscapeDataString(location) - + "/connectors" + + "/connectors/" + + global::System.Uri.EscapeDataString(connectorName) + + "/generateConfigurations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1810,70 +2136,93 @@ public partial class ServiceLinker // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ConnectorList_Call(request,onOk,onDefault,eventListener,sender); + await this.ConnectorGenerateConfigurations_Call (request, onOk,onDefault,eventListener,sender); } } - /// list dryrun jobs - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of Azure region. + /// Generate configurations for a Connector. + /// + /// Connection Info, including format, secret store, etc /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConnectorListDryrun(string subscriptionId, string resourceGroupName, string location, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorGenerateConfigurationsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01-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.ServiceLinker/locations/" - + global::System.Uri.EscapeDataString(location) - + "/dryruns" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.ServiceLinker/locations/(?[^/]+)/connectors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var location = _match.Groups["location"].Value; + var connectorName = _match.Groups["connectorName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.ServiceLinker/locations/" + + location + + "/connectors/" + + connectorName + + "/generateConfigurations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ConnectorListDryrun_Call(request,onOk,onDefault,eventListener,sender); + await this.ConnectorGenerateConfigurations_Call (request, onOk,onDefault,eventListener,sender); } } - /// list dryrun jobs + /// Generate configurations for a Connector. /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Connection Info, including format, secret store, etc /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConnectorListDryrunViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorGenerateConfigurationsViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -1881,16 +2230,17 @@ public partial class ServiceLinker { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.ServiceLinker/locations/(?[^/]+)/dryruns$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.ServiceLinker/locations/(?[^/]+)/connectors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var location = _match.Groups["location"].Value; + var connectorName = _match.Groups["connectorName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -1899,26 +2249,36 @@ public partial class ServiceLinker + resourceGroupName + "/providers/Microsoft.ServiceLinker/locations/" + location - + "/dryruns" + + "/connectors/" + + connectorName + + "/generateConfigurations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ConnectorListDryrun_Call(request,onOk,onDefault,eventListener,sender); + return await this.ConnectorGenerateConfigurationsWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. + /// Generate configurations for a Connector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of resource. + /// Json string supplied to the ConnectorGenerateConfigurations 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). @@ -1927,128 +2287,208 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ConnectorListDryrun_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorGenerateConfigurationsViaJsonString(string subscriptionId, string resourceGroupName, string location, string connectorName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourcegroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ServiceLinker/locations/" + + global::System.Uri.EscapeDataString(location) + + "/connectors/" + + global::System.Uri.EscapeDataString(connectorName) + + "/generateConfigurations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ConnectorGenerateConfigurations_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// + /// Generate configurations for a Connector. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of Azure region. + /// The name of resource. + /// Json string supplied to the ConnectorGenerateConfigurations operation /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ConnectorListDryrun_Validate(string subscriptionId, string resourceGroupName, string location, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task ConnectorGenerateConfigurationsViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string location, string connectorName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(location),location); - await eventListener.AssertMinimumLength(nameof(location),location,1); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourcegroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ServiceLinker/locations/" + + global::System.Uri.EscapeDataString(location) + + "/connectors/" + + global::System.Uri.EscapeDataString(connectorName) + + "/generateConfigurations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConnectorGenerateConfigurationsWithResult_Call (request, eventListener,sender); } } - /// - /// Returns list of connector which connects to the resource, which supports to config the target service during the resource - /// provision. - /// - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Generate configurations for a Connector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of resource. + /// Connection Info, including format, secret store, etc /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConnectorListViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorGenerateConfigurationsWithResult(string subscriptionId, string resourceGroupName, string location, string connectorName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.ServiceLinker/locations/(?[^/]+)/connectors$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var location = _match.Groups["location"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourcegroups/" - + resourceGroupName + + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.ServiceLinker/locations/" - + location - + "/connectors" + + global::System.Uri.EscapeDataString(location) + + "/connectors/" + + global::System.Uri.EscapeDataString(connectorName) + + "/generateConfigurations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ConnectorList_Call(request,onOk,onDefault,eventListener,sender); + return await this.ConnectorGenerateConfigurationsWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConnectorGenerateConfigurationsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -2058,7 +2498,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ConnectorList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ConnectorGenerateConfigurations_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2069,6 +2509,7 @@ public partial class ServiceLinker await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2076,13 +2517,13 @@ public partial class ServiceLinker case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ResourceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2098,17 +2539,19 @@ public partial class ServiceLinker } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of Azure region. + /// The name of resource. + /// Connection Info, including format, secret store, etc /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ConnectorList_Validate(string subscriptionId, string resourceGroupName, string location, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ConnectorGenerateConfigurations_Validate(string subscriptionId, string resourceGroupName, string location, string connectorName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -2119,15 +2562,17 @@ public partial class ServiceLinker await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(location),location); await eventListener.AssertMinimumLength(nameof(location),location,1); + await eventListener.AssertNotNull(nameof(connectorName),connectorName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Operation to update an existing Connector. + /// Returns Connector resource for a given name. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of Azure region. /// The name of resource. - /// Connector details. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -2136,7 +2581,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConnectorUpdate(string subscriptionId, string resourceGroupName, string location, string connectorName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorGet(string subscriptionId, string resourceGroupName, string location, string connectorName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -2160,25 +2605,20 @@ public partial class ServiceLinker // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ConnectorUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.ConnectorGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// update a dryrun job to do necessary check before actual creation + /// get a dryrun job /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of Azure region. /// The name of dryrun. - /// dryrun 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). @@ -2187,7 +2627,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConnectorUpdateDryrun(string subscriptionId, string resourceGroupName, string location, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorGetDryrun(string subscriptionId, string resourceGroupName, string location, string dryrunName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -2211,22 +2651,17 @@ public partial class ServiceLinker // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ConnectorUpdateDryrun_Call(request,onOk,onDefault,eventListener,sender); + await this.ConnectorGetDryrun_Call (request, onOk,onDefault,eventListener,sender); } } - /// update a dryrun job to do necessary check before actual creation + /// get a dryrun job /// - /// dryrun 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). @@ -2235,7 +2670,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConnectorUpdateDryrunViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorGetDryrunViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -2272,136 +2707,195 @@ public partial class ServiceLinker // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ConnectorUpdateDryrun_Call(request,onOk,onDefault,eventListener,sender); + await this.ConnectorGetDryrun_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// get a dryrun job + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ConnectorUpdateDryrun_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorGetDryrunViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.ServiceLinker/locations/(?[^/]+)/dryruns/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var location = _match.Groups["location"].Value; + var dryrunName = _match.Groups["dryrunName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.ServiceLinker/locations/" + + location + + "/dryruns/" + + dryrunName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // 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.ServiceLinker.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConnectorGetDryrunWithResult_Call (request, eventListener,sender); + } + } - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; + /// get a dryrun job + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of dryrun. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConnectorGetDryrunWithResult(string subscriptionId, string resourceGroupName, string location, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-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.ServiceLinker/locations/" + + global::System.Uri.EscapeDataString(location) + + "/dryruns/" + + global::System.Uri.EscapeDataString(dryrunName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // drop the old response - _response?.Dispose(); + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConnectorGetDryrunWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConnectorGetDryrunWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.UndeclaredResponseException(_response); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + default: { - continue; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConnectorGetDryrun_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2409,13 +2903,13 @@ public partial class ServiceLinker case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2431,19 +2925,18 @@ public partial class ServiceLinker } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of Azure region. /// The name of dryrun. - /// dryrun 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 ConnectorUpdateDryrun_Validate(string subscriptionId, string resourceGroupName, string location, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatch body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ConnectorGetDryrun_Validate(string subscriptionId, string resourceGroupName, string location, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -2455,14 +2948,11 @@ public partial class ServiceLinker await eventListener.AssertNotNull(nameof(location),location); await eventListener.AssertMinimumLength(nameof(location),location,1); await eventListener.AssertNotNull(nameof(dryrunName),dryrunName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Operation to update an existing Connector. + /// Returns Connector resource for a given name. /// - /// Connector details. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -2471,7 +2961,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConnectorUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorGetViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -2508,136 +2998,195 @@ public partial class ServiceLinker // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ConnectorUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.ConnectorGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Returns Connector resource for a given name. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ConnectorUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.ServiceLinker/locations/(?[^/]+)/connectors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}'"); + } - // 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.ServiceLinker.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var location = _match.Groups["location"].Value; + var connectorName = _match.Groups["connectorName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.ServiceLinker/locations/" + + location + + "/connectors/" + + connectorName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get); + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConnectorGetWithResult_Call (request, eventListener,sender); + } + } + + /// Returns Connector resource for a given name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConnectorGetWithResult(string subscriptionId, string resourceGroupName, string location, string connectorName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-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.ServiceLinker/locations/" + + global::System.Uri.EscapeDataString(location) + + "/connectors/" + + global::System.Uri.EscapeDataString(connectorName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // drop the old response - _response?.Dispose(); + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConnectorGetWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConnectorGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.UndeclaredResponseException(_response); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + default: { - continue; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConnectorGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2645,13 +3194,13 @@ public partial class ServiceLinker case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2667,19 +3216,18 @@ public partial class ServiceLinker } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of Azure region. /// The name of resource. - /// Connector details. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ConnectorUpdate_Validate(string subscriptionId, string resourceGroupName, string location, string connectorName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatch body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ConnectorGet_Validate(string subscriptionId, string resourceGroupName, string location, string connectorName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -2691,16 +3239,16 @@ public partial class ServiceLinker await eventListener.AssertNotNull(nameof(location),location); await eventListener.AssertMinimumLength(nameof(location),location,1); await eventListener.AssertNotNull(nameof(connectorName),connectorName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Validate a Connector. + /// + /// Returns list of connector which connects to the resource, which supports to config the target service during the resource + /// provision. + /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of Azure region. - /// The name of 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). @@ -2709,7 +3257,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConnectorValidate(string subscriptionId, string resourceGroupName, string location, string connectorName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorList(string subscriptionId, string resourceGroupName, string location, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -2723,9 +3271,7 @@ public partial class ServiceLinker + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.ServiceLinker/locations/" + global::System.Uri.EscapeDataString(location) - + "/connectors/" - + global::System.Uri.EscapeDataString(connectorName) - + "/validate" + + "/connectors" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2734,16 +3280,60 @@ public partial class ServiceLinker // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ConnectorValidate_Call(request,onOk,onDefault,eventListener,sender); + await this.ConnectorList_Call (request, onOk,onDefault,eventListener,sender); } } - /// Validate a Connector. + /// list dryrun jobs + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of 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.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConnectorListDryrun(string subscriptionId, string resourceGroupName, string location, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-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.ServiceLinker/locations/" + + global::System.Uri.EscapeDataString(location) + + "/dryruns" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ConnectorListDryrun_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// list dryrun jobs /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -2753,7 +3343,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConnectorValidateViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorListDryrunViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -2761,17 +3351,16 @@ public partial class ServiceLinker { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.ServiceLinker/locations/(?[^/]+)/connectors/(?[^/]+)/validate$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.ServiceLinker/locations/(?[^/]+)/dryruns$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}/validate'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var location = _match.Groups["location"].Value; - var connectorName = _match.Groups["connectorName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -2780,9 +3369,7 @@ public partial class ServiceLinker + resourceGroupName + "/providers/Microsoft.ServiceLinker/locations/" + location - + "/connectors/" - + connectorName - + "/validate" + + "/dryruns" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2791,133 +3378,191 @@ public partial class ServiceLinker // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ConnectorValidate_Call(request,onOk,onDefault,eventListener,sender); + await this.ConnectorListDryrun_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). + /// list dryrun jobs + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ConnectorValidate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorListDryrunViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // verify that Identity format is an exact match for uri - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.ServiceLinker/locations/(?[^/]+)/dryruns$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns'"); + } - // 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.ServiceLinker.Runtime.Method.Get); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var location = _match.Groups["location"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.ServiceLinker/locations/" + + location + + "/dryruns" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConnectorListDryrunWithResult_Call (request, eventListener,sender); + } + } - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + /// list dryrun jobs + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConnectorListDryrunWithResult(string subscriptionId, string resourceGroupName, string location, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-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.ServiceLinker/locations/" + + global::System.Uri.EscapeDataString(location) + + "/dryruns" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConnectorListDryrunWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConnectorListDryrunWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.UndeclaredResponseException(_response); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + default: { - continue; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConnectorListDryrun_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2925,13 +3570,13 @@ public partial class ServiceLinker case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ValidateOperationResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2947,18 +3592,17 @@ public partial class ServiceLinker } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of Azure region. - /// The name of 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 ConnectorValidate_Validate(string subscriptionId, string resourceGroupName, string location, string connectorName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ConnectorListDryrun_Validate(string subscriptionId, string resourceGroupName, string location, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -2969,15 +3613,14 @@ public partial class ServiceLinker await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(location),location); await eventListener.AssertMinimumLength(nameof(location),location,1); - await eventListener.AssertNotNull(nameof(connectorName),connectorName); } } - /// Create or update Linker resource. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name Linker resource. - /// - /// Linker details. + /// + /// Returns list of connector which connects to the resource, which supports to config the target service during the resource + /// provision. + /// + /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -2986,18 +3629,33 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LinkerCreateOrUpdate(string resourceUri, string linkerName, string xMSServiceconnectorUserToken, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorListViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.ServiceLinker/locations/(?[^/]+)/connectors$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var location = _match.Groups["location"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + (resourceUri) - + "/providers/Microsoft.ServiceLinker/linkers/" - + global::System.Uri.EscapeDataString(linkerName) + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.ServiceLinker/locations/" + + location + + "/connectors" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3006,38 +3664,27 @@ public partial class ServiceLinker // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != xMSServiceconnectorUserToken) - { - request.Headers.Add("x-ms-serviceconnector-user-token",xMSServiceconnectorUserToken); - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.LinkerCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.ConnectorList_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create or update Linker resource. + /// + /// Returns list of connector which connects to the resource, which supports to config the target service during the resource + /// provision. + /// /// - /// - /// Linker details. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LinkerCreateOrUpdateViaIdentity(global::System.String viaIdentity, string xMSServiceconnectorUserToken, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ConnectorListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -3045,49 +3692,4358 @@ public partial class ServiceLinker { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/linkers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'"); - } + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.ServiceLinker/locations/(?[^/]+)/connectors$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var location = _match.Groups["location"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.ServiceLinker/locations/" + + location + + "/connectors" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConnectorListWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Returns list of connector which connects to the resource, which supports to config the target service during the resource + /// provision. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConnectorListWithResult(string subscriptionId, string resourceGroupName, string location, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-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.ServiceLinker/locations/" + + global::System.Uri.EscapeDataString(location) + + "/connectors" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConnectorListWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConnectorListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ResourceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConnectorList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ResourceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of 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 ConnectorList_Validate(string subscriptionId, string resourceGroupName, string location, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(location),location); + await eventListener.AssertMinimumLength(nameof(location),location,1); + } + } + + /// Operation to update an existing Connector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of resource. + /// Connector details. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConnectorUpdate(string subscriptionId, string resourceGroupName, string location, string connectorName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-01-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.ServiceLinker/locations/" + + global::System.Uri.EscapeDataString(location) + + "/connectors/" + + global::System.Uri.EscapeDataString(connectorName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ConnectorUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update a dryrun job to do necessary check before actual creation + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of dryrun. + /// dryrun 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.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConnectorUpdateDryrun(string subscriptionId, string resourceGroupName, string location, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-01-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.ServiceLinker/locations/" + + global::System.Uri.EscapeDataString(location) + + "/dryruns/" + + global::System.Uri.EscapeDataString(dryrunName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ConnectorUpdateDryrun_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update a dryrun job to do necessary check before actual creation + /// + /// dryrun 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.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConnectorUpdateDryrunViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.ServiceLinker/locations/(?[^/]+)/dryruns/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var location = _match.Groups["location"].Value; + var dryrunName = _match.Groups["dryrunName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.ServiceLinker/locations/" + + location + + "/dryruns/" + + dryrunName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ConnectorUpdateDryrun_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update a dryrun job to do necessary check before actual creation + /// + /// dryrun resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConnectorUpdateDryrunViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatch body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.ServiceLinker/locations/(?[^/]+)/dryruns/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var location = _match.Groups["location"].Value; + var dryrunName = _match.Groups["dryrunName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.ServiceLinker/locations/" + + location + + "/dryruns/" + + dryrunName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConnectorUpdateDryrunWithResult_Call (request, eventListener,sender); + } + } + + /// update a dryrun job to do necessary check before actual creation + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of dryrun. + /// Json string supplied to the ConnectorUpdateDryrun 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.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConnectorUpdateDryrunViaJsonString(string subscriptionId, string resourceGroupName, string location, string dryrunName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-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.ServiceLinker/locations/" + + global::System.Uri.EscapeDataString(location) + + "/dryruns/" + + global::System.Uri.EscapeDataString(dryrunName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ConnectorUpdateDryrun_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update a dryrun job to do necessary check before actual creation + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of dryrun. + /// Json string supplied to the ConnectorUpdateDryrun operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConnectorUpdateDryrunViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string location, string dryrunName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-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.ServiceLinker/locations/" + + global::System.Uri.EscapeDataString(location) + + "/dryruns/" + + global::System.Uri.EscapeDataString(dryrunName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConnectorUpdateDryrunWithResult_Call (request, eventListener,sender); + } + } + + /// update a dryrun job to do necessary check before actual creation + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of dryrun. + /// dryrun resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConnectorUpdateDryrunWithResult(string subscriptionId, string resourceGroupName, string location, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatch body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-01-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.ServiceLinker/locations/" + + global::System.Uri.EscapeDataString(location) + + "/dryruns/" + + global::System.Uri.EscapeDataString(dryrunName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConnectorUpdateDryrunWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConnectorUpdateDryrunWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConnectorUpdateDryrun_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of dryrun. + /// dryrun 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 ConnectorUpdateDryrun_Validate(string subscriptionId, string resourceGroupName, string location, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatch body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(location),location); + await eventListener.AssertMinimumLength(nameof(location),location,1); + await eventListener.AssertNotNull(nameof(dryrunName),dryrunName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Operation to update an existing Connector. + /// + /// Connector details. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConnectorUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.ServiceLinker/locations/(?[^/]+)/connectors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var location = _match.Groups["location"].Value; + var connectorName = _match.Groups["connectorName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.ServiceLinker/locations/" + + location + + "/connectors/" + + connectorName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ConnectorUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Operation to update an existing Connector. + /// + /// Connector details. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConnectorUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatch body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.ServiceLinker/locations/(?[^/]+)/connectors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var location = _match.Groups["location"].Value; + var connectorName = _match.Groups["connectorName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.ServiceLinker/locations/" + + location + + "/connectors/" + + connectorName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConnectorUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Operation to update an existing Connector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of resource. + /// Json string supplied to the ConnectorUpdate 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.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConnectorUpdateViaJsonString(string subscriptionId, string resourceGroupName, string location, string connectorName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-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.ServiceLinker/locations/" + + global::System.Uri.EscapeDataString(location) + + "/connectors/" + + global::System.Uri.EscapeDataString(connectorName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ConnectorUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Operation to update an existing Connector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of resource. + /// Json string supplied to the ConnectorUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConnectorUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string location, string connectorName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-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.ServiceLinker/locations/" + + global::System.Uri.EscapeDataString(location) + + "/connectors/" + + global::System.Uri.EscapeDataString(connectorName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConnectorUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Operation to update an existing Connector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of resource. + /// Connector details. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConnectorUpdateWithResult(string subscriptionId, string resourceGroupName, string location, string connectorName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatch body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-01-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.ServiceLinker/locations/" + + global::System.Uri.EscapeDataString(location) + + "/connectors/" + + global::System.Uri.EscapeDataString(connectorName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConnectorUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConnectorUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConnectorUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of resource. + /// Connector details. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConnectorUpdate_Validate(string subscriptionId, string resourceGroupName, string location, string connectorName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatch body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(location),location); + await eventListener.AssertMinimumLength(nameof(location),location,1); + await eventListener.AssertNotNull(nameof(connectorName),connectorName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Validate a Connector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of 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.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConnectorValidate(string subscriptionId, string resourceGroupName, string location, string connectorName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-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.ServiceLinker/locations/" + + global::System.Uri.EscapeDataString(location) + + "/connectors/" + + global::System.Uri.EscapeDataString(connectorName) + + "/validate" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ConnectorValidate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Validate a Connector. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConnectorValidateViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.ServiceLinker/locations/(?[^/]+)/connectors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var location = _match.Groups["location"].Value; + var connectorName = _match.Groups["connectorName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.ServiceLinker/locations/" + + location + + "/connectors/" + + connectorName + + "/validate" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ConnectorValidate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Validate a Connector. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConnectorValidateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.ServiceLinker/locations/(?[^/]+)/connectors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var location = _match.Groups["location"].Value; + var connectorName = _match.Groups["connectorName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.ServiceLinker/locations/" + + location + + "/connectors/" + + connectorName + + "/validate" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConnectorValidateWithResult_Call (request, eventListener,sender); + } + } + + /// Validate a Connector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConnectorValidateWithResult(string subscriptionId, string resourceGroupName, string location, string connectorName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-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.ServiceLinker/locations/" + + global::System.Uri.EscapeDataString(location) + + "/connectors/" + + global::System.Uri.EscapeDataString(connectorName) + + "/validate" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConnectorValidateWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConnectorValidateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.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.ServiceLinker.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.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ValidateOperationResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConnectorValidate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.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.ServiceLinker.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.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ValidateOperationResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of 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 ConnectorValidate_Validate(string subscriptionId, string resourceGroupName, string location, string connectorName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(location),location); + await eventListener.AssertMinimumLength(nameof(location),location,1); + await eventListener.AssertNotNull(nameof(connectorName),connectorName); + } + } + + /// update Linker resource. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name Linker resource. + /// + /// Linker details. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerCreateOrUpdate(string resourceUri, string linkerName, string xMSServiceconnectorUserToken, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceUri) + + "/providers/Microsoft.ServiceLinker/linkers/" + + global::System.Uri.EscapeDataString(linkerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != xMSServiceconnectorUserToken) + { + request.Headers.Add("x-ms-serviceconnector-user-token",xMSServiceconnectorUserToken); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LinkerCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update Linker resource. + /// + /// + /// Linker details. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerCreateOrUpdateViaIdentity(global::System.String viaIdentity, string xMSServiceconnectorUserToken, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/linkers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'"); + } + + // replace URI parameters with values from identity + var resourceUri = _match.Groups["resourceUri"].Value; + var linkerName = _match.Groups["linkerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceUri + + "/providers/Microsoft.ServiceLinker/linkers/" + + linkerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != xMSServiceconnectorUserToken) + { + request.Headers.Add("x-ms-serviceconnector-user-token",xMSServiceconnectorUserToken); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LinkerCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update Linker resource. + /// + /// + /// Linker details. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, string xMSServiceconnectorUserToken, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/linkers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'"); + } + + // replace URI parameters with values from identity + var resourceUri = _match.Groups["resourceUri"].Value; + var linkerName = _match.Groups["linkerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceUri + + "/providers/Microsoft.ServiceLinker/linkers/" + + linkerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != xMSServiceconnectorUserToken) + { + request.Headers.Add("x-ms-serviceconnector-user-token",xMSServiceconnectorUserToken); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LinkerCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update Linker resource. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name Linker resource. + /// + /// Json string supplied to the LinkerCreateOrUpdate 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.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerCreateOrUpdateViaJsonString(string resourceUri, string linkerName, string xMSServiceconnectorUserToken, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceUri) + + "/providers/Microsoft.ServiceLinker/linkers/" + + global::System.Uri.EscapeDataString(linkerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != xMSServiceconnectorUserToken) + { + request.Headers.Add("x-ms-serviceconnector-user-token",xMSServiceconnectorUserToken); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LinkerCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update Linker resource. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name Linker resource. + /// + /// Json string supplied to the LinkerCreateOrUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerCreateOrUpdateViaJsonStringWithResult(string resourceUri, string linkerName, string xMSServiceconnectorUserToken, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceUri) + + "/providers/Microsoft.ServiceLinker/linkers/" + + global::System.Uri.EscapeDataString(linkerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != xMSServiceconnectorUserToken) + { + request.Headers.Add("x-ms-serviceconnector-user-token",xMSServiceconnectorUserToken); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LinkerCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update Linker resource. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name Linker resource. + /// + /// Linker details. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerCreateOrUpdateWithResult(string resourceUri, string linkerName, string xMSServiceconnectorUserToken, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceUri) + + "/providers/Microsoft.ServiceLinker/linkers/" + + global::System.Uri.EscapeDataString(linkerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != xMSServiceconnectorUserToken) + { + request.Headers.Add("x-ms-serviceconnector-user-token",xMSServiceconnectorUserToken); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LinkerCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LinkerCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LinkerCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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 fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name Linker resource. + /// + /// Linker details. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LinkerCreateOrUpdate_Validate(string resourceUri, string linkerName, string xMSServiceconnectorUserToken, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceUri),resourceUri); + await eventListener.AssertNotNull(nameof(linkerName),linkerName); + await eventListener.AssertNotNull(nameof(xMSServiceconnectorUserToken),xMSServiceconnectorUserToken); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete a Linker. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name Linker 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.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerDelete(string resourceUri, string linkerName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceUri) + + "/providers/Microsoft.ServiceLinker/linkers/" + + global::System.Uri.EscapeDataString(linkerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LinkerDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete a Linker. + /// + /// 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.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerDeleteViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/linkers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'"); + } + + // replace URI parameters with values from identity + var resourceUri = _match.Groups["resourceUri"].Value; + var linkerName = _match.Groups["linkerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceUri + + "/providers/Microsoft.ServiceLinker/linkers/" + + linkerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LinkerDelete_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.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LinkerDelete_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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: azure-async-operation + var _finalUri = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.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.ServiceLinker.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.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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 fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name Linker 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 LinkerDelete_Validate(string resourceUri, string linkerName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceUri),resourceUri); + await eventListener.AssertNotNull(nameof(linkerName),linkerName); + } + } + + /// Returns Linker resource for a given name. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name Linker 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.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerGet(string resourceUri, string linkerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceUri) + + "/providers/Microsoft.ServiceLinker/linkers/" + + global::System.Uri.EscapeDataString(linkerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LinkerGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Returns Linker resource for a given name. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerGetViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/linkers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'"); + } + + // replace URI parameters with values from identity + var resourceUri = _match.Groups["resourceUri"].Value; + var linkerName = _match.Groups["linkerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceUri + + "/providers/Microsoft.ServiceLinker/linkers/" + + linkerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LinkerGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Returns Linker resource for a given name. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/linkers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'"); + } + + // replace URI parameters with values from identity + var resourceUri = _match.Groups["resourceUri"].Value; + var linkerName = _match.Groups["linkerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceUri + + "/providers/Microsoft.ServiceLinker/linkers/" + + linkerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LinkerGetWithResult_Call (request, eventListener,sender); + } + } + + /// Returns Linker resource for a given name. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name Linker resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerGetWithResult(string resourceUri, string linkerName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceUri) + + "/providers/Microsoft.ServiceLinker/linkers/" + + global::System.Uri.EscapeDataString(linkerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LinkerGetWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LinkerGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LinkerGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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 fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name Linker 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 LinkerGet_Validate(string resourceUri, string linkerName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceUri),resourceUri); + await eventListener.AssertNotNull(nameof(linkerName),linkerName); + } + } + + /// + /// Returns list of Linkers which connects to the resource. which supports to config both application and target service during + /// the resource provision. + /// + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerList(string resourceUri, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceUri) + + "/providers/Microsoft.ServiceLinker/linkers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LinkerList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// list source configurations for a Linker. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name Linker 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.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerListConfigurations(string resourceUri, string linkerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceUri) + + "/providers/Microsoft.ServiceLinker/linkers/" + + global::System.Uri.EscapeDataString(linkerName) + + "/listConfigurations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LinkerListConfigurations_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// list source configurations for a Linker. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerListConfigurationsViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/linkers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'"); + } + + // replace URI parameters with values from identity + var resourceUri = _match.Groups["resourceUri"].Value; + var linkerName = _match.Groups["linkerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceUri + + "/providers/Microsoft.ServiceLinker/linkers/" + + linkerName + + "/listConfigurations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LinkerListConfigurations_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// list source configurations for a Linker. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerListConfigurationsViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/linkers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'"); + } + + // replace URI parameters with values from identity + var resourceUri = _match.Groups["resourceUri"].Value; + var linkerName = _match.Groups["linkerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceUri + + "/providers/Microsoft.ServiceLinker/linkers/" + + linkerName + + "/listConfigurations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LinkerListConfigurationsWithResult_Call (request, eventListener,sender); + } + } + + /// list source configurations for a Linker. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name Linker resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerListConfigurationsWithResult(string resourceUri, string linkerName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceUri) + + "/providers/Microsoft.ServiceLinker/linkers/" + + global::System.Uri.EscapeDataString(linkerName) + + "/listConfigurations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LinkerListConfigurationsWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LinkerListConfigurationsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LinkerListConfigurations_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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 fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name Linker 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 LinkerListConfigurations_Validate(string resourceUri, string linkerName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceUri),resourceUri); + await eventListener.AssertNotNull(nameof(linkerName),linkerName); + } + } + + /// + /// Returns list of Linkers which connects to the resource. which supports to config both application and target service during + /// the resource provision. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerListViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/linkers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers'"); + } + + // replace URI parameters with values from identity + var resourceUri = _match.Groups["resourceUri"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceUri + + "/providers/Microsoft.ServiceLinker/linkers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LinkerList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Returns list of Linkers which connects to the resource. which supports to config both application and target service during + /// the resource provision. + /// + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/linkers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers'"); + } + + // replace URI parameters with values from identity + var resourceUri = _match.Groups["resourceUri"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceUri + + "/providers/Microsoft.ServiceLinker/linkers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LinkerListWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Returns list of Linkers which connects to the resource. which supports to config both application and target service during + /// the resource provision. + /// + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerListWithResult(string resourceUri, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceUri) + + "/providers/Microsoft.ServiceLinker/linkers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LinkerListWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LinkerListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ResourceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LinkerList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ResourceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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 fully qualified Azure Resource manager identifier of the resource to be connected. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LinkerList_Validate(string resourceUri, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceUri),resourceUri); + } + } + + /// Operation to update an existing Linker. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name Linker resource. + /// + /// Linker details. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerUpdate(string resourceUri, string linkerName, string xMSServiceconnectorUserToken, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceUri) + + "/providers/Microsoft.ServiceLinker/linkers/" + + global::System.Uri.EscapeDataString(linkerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != xMSServiceconnectorUserToken) + { + request.Headers.Add("x-ms-serviceconnector-user-token",xMSServiceconnectorUserToken); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LinkerUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Operation to update an existing Linker. + /// + /// + /// Linker details. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerUpdateViaIdentity(global::System.String viaIdentity, string xMSServiceconnectorUserToken, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/linkers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'"); + } + + // replace URI parameters with values from identity + var resourceUri = _match.Groups["resourceUri"].Value; + var linkerName = _match.Groups["linkerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceUri + + "/providers/Microsoft.ServiceLinker/linkers/" + + linkerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != xMSServiceconnectorUserToken) + { + request.Headers.Add("x-ms-serviceconnector-user-token",xMSServiceconnectorUserToken); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LinkerUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Operation to update an existing Linker. + /// + /// + /// Linker details. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerUpdateViaIdentityWithResult(global::System.String viaIdentity, string xMSServiceconnectorUserToken, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatch body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/linkers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'"); + } + + // replace URI parameters with values from identity + var resourceUri = _match.Groups["resourceUri"].Value; + var linkerName = _match.Groups["linkerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceUri + + "/providers/Microsoft.ServiceLinker/linkers/" + + linkerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != xMSServiceconnectorUserToken) + { + request.Headers.Add("x-ms-serviceconnector-user-token",xMSServiceconnectorUserToken); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LinkerUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Operation to update an existing Linker. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name Linker resource. + /// + /// Json string supplied to the LinkerUpdate 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.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerUpdateViaJsonString(string resourceUri, string linkerName, string xMSServiceconnectorUserToken, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceUri) + + "/providers/Microsoft.ServiceLinker/linkers/" + + global::System.Uri.EscapeDataString(linkerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != xMSServiceconnectorUserToken) + { + request.Headers.Add("x-ms-serviceconnector-user-token",xMSServiceconnectorUserToken); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LinkerUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Operation to update an existing Linker. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name Linker resource. + /// + /// Json string supplied to the LinkerUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerUpdateViaJsonStringWithResult(string resourceUri, string linkerName, string xMSServiceconnectorUserToken, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceUri) + + "/providers/Microsoft.ServiceLinker/linkers/" + + global::System.Uri.EscapeDataString(linkerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != xMSServiceconnectorUserToken) + { + request.Headers.Add("x-ms-serviceconnector-user-token",xMSServiceconnectorUserToken); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LinkerUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Operation to update an existing Linker. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name Linker resource. + /// + /// Linker details. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerUpdateWithResult(string resourceUri, string linkerName, string xMSServiceconnectorUserToken, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatch body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceUri) + + "/providers/Microsoft.ServiceLinker/linkers/" + + global::System.Uri.EscapeDataString(linkerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != xMSServiceconnectorUserToken) + { + request.Headers.Add("x-ms-serviceconnector-user-token",xMSServiceconnectorUserToken); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LinkerUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LinkerUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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(); - // replace URI parameters with values from identity - var resourceUri = _match.Groups["resourceUri"].Value; - var linkerName = _match.Groups["linkerName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + resourceUri - + "/providers/Microsoft.ServiceLinker/linkers/" - + linkerName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + // drop the old response + _response?.Dispose(); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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; - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException(_response); + } + } - // add headers parameters - if (null != xMSServiceconnectorUserToken) + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - request.Headers.Add("x-ms-serviceconnector-user-token",xMSServiceconnectorUserToken); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LinkerCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -3097,31 +8053,28 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task LinkerCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LinkerUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: azure-async-operation var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -3130,15 +8083,14 @@ public partial class ServiceLinker if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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(); @@ -3147,45 +8099,45 @@ public partial class ServiceLinker _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -3204,6 +8156,7 @@ public partial class ServiceLinker await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3211,13 +8164,13 @@ public partial class ServiceLinker case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3233,7 +8186,7 @@ public partial class ServiceLinker } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// /// The fully qualified Azure Resource manager identifier of the resource to be connected. @@ -3244,7 +8197,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task LinkerCreateOrUpdate_Validate(string resourceUri, string linkerName, string xMSServiceconnectorUserToken, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task LinkerUpdate_Validate(string resourceUri, string linkerName, string xMSServiceconnectorUserToken, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatch body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -3256,11 +8209,10 @@ public partial class ServiceLinker } } - /// Delete a Linker. + /// Validate a Linker. /// The fully qualified Azure Resource manager identifier of the resource to be connected. /// The name Linker 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. @@ -3268,7 +8220,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LinkerDelete(string resourceUri, string linkerName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LinkerValidate(string resourceUri, string linkerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -3280,6 +8232,7 @@ public partial class ServiceLinker + (resourceUri) + "/providers/Microsoft.ServiceLinker/linkers/" + global::System.Uri.EscapeDataString(linkerName) + + "/validateLinker" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3288,19 +8241,18 @@ public partial class ServiceLinker // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.LinkerDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.LinkerValidate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete a Linker. + /// Validate a Linker. /// /// 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. @@ -3308,7 +8260,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LinkerDeleteViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LinkerValidateViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -3331,6 +8283,7 @@ public partial class ServiceLinker + resourceUri + "/providers/Microsoft.ServiceLinker/linkers/" + linkerName + + "/validateLinker" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3339,19 +8292,259 @@ public partial class ServiceLinker // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.LinkerDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.LinkerValidate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Validate a Linker. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerValidateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/linkers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'"); + } + + // replace URI parameters with values from identity + var resourceUri = _match.Groups["resourceUri"].Value; + var linkerName = _match.Groups["linkerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceUri + + "/providers/Microsoft.ServiceLinker/linkers/" + + linkerName + + "/validateLinker" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LinkerValidateWithResult_Call (request, eventListener,sender); + } + } + + /// Validate a Linker. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name Linker resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkerValidateWithResult(string resourceUri, string linkerName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceUri) + + "/providers/Microsoft.ServiceLinker/linkers/" + + global::System.Uri.EscapeDataString(linkerName) + + "/validateLinker" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LinkerValidateWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LinkerValidateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.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.ServiceLinker.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.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ValidateOperationResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -3359,32 +8552,29 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task LinkerDelete_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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LinkerValidate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation - var _finalUri = _response.GetFirstHeader(@"Azure-AsyncOperation"); + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -3393,15 +8583,14 @@ public partial class ServiceLinker if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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(); @@ -3410,45 +8599,45 @@ public partial class ServiceLinker _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -3467,6 +8656,7 @@ public partial class ServiceLinker await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3474,19 +8664,13 @@ public partial class ServiceLinker case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ValidateOperationResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3502,7 +8686,7 @@ public partial class ServiceLinker } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// /// The fully qualified Azure Resource manager identifier of the resource to be connected. @@ -3511,7 +8695,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task LinkerDelete_Validate(string resourceUri, string linkerName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task LinkerValidate_Validate(string resourceUri, string linkerName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -3520,18 +8704,20 @@ public partial class ServiceLinker } } - /// Returns Linker resource for a given name. + /// create a dryrun job to do necessary check before actual creation /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name Linker resource. + /// The name of dryrun. + /// dryrun 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.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LinkerGet(string resourceUri, string linkerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LinkersCreateDryrun(string resourceUri, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -3541,8 +8727,8 @@ public partial class ServiceLinker var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (resourceUri) - + "/providers/Microsoft.ServiceLinker/linkers/" - + global::System.Uri.EscapeDataString(linkerName) + + "/providers/Microsoft.ServiceLinker/dryruns/" + + global::System.Uri.EscapeDataString(dryrunName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3551,26 +8737,32 @@ public partial class ServiceLinker // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.LinkerGet_Call(request,onOk,onDefault,eventListener,sender); + await this.LinkersCreateDryrun_Call (request, onOk,onDefault,eventListener,sender); } } - /// Returns Linker resource for a given name. + /// create a dryrun job to do necessary check before actual creation /// + /// dryrun 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.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LinkerGetViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LinkersCreateDryrunViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -3578,21 +8770,21 @@ public partial class ServiceLinker { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/linkers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/dryruns/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'"); + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}'"); } // replace URI parameters with values from identity var resourceUri = _match.Groups["resourceUri"].Value; - var linkerName = _match.Groups["linkerName"].Value; + var dryrunName = _match.Groups["dryrunName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + resourceUri - + "/providers/Microsoft.ServiceLinker/linkers/" - + linkerName + + "/providers/Microsoft.ServiceLinker/dryruns/" + + dryrunName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3601,88 +8793,77 @@ public partial class ServiceLinker // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.LinkerGet_Call(request,onOk,onDefault,eventListener,sender); + await this.LinkersCreateDryrun_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). + /// create a dryrun job to do necessary check before actual creation + /// + /// dryrun resource. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task LinkerGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LinkersCreateDryrunViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/dryruns/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get validation events - /// back. - /// - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name Linker 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 LinkerGet_Validate(string resourceUri, string linkerName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(resourceUri),resourceUri); - await eventListener.AssertNotNull(nameof(linkerName),linkerName); + // replace URI parameters with values from identity + var resourceUri = _match.Groups["resourceUri"].Value; + var dryrunName = _match.Groups["dryrunName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceUri + + "/providers/Microsoft.ServiceLinker/dryruns/" + + dryrunName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LinkersCreateDryrunWithResult_Call (request, eventListener,sender); } } - /// - /// Returns list of Linkers which connects to the resource. which supports to config both application and target service during - /// the resource provision. - /// + /// create a dryrun job to do necessary check before actual creation /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name of dryrun. + /// Json string supplied to the LinkersCreateDryrun 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). @@ -3691,7 +8872,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LinkerList(string resourceUri, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LinkersCreateDryrunViaJsonString(string resourceUri, string dryrunName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -3701,7 +8882,8 @@ public partial class ServiceLinker var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (resourceUri) - + "/providers/Microsoft.ServiceLinker/linkers" + + "/providers/Microsoft.ServiceLinker/dryruns/" + + global::System.Uri.EscapeDataString(dryrunName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3710,27 +8892,30 @@ public partial class ServiceLinker // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.LinkerList_Call(request,onOk,onDefault,eventListener,sender); + await this.LinkersCreateDryrun_Call (request, onOk,onDefault,eventListener,sender); } } - /// list source configurations for a Linker. + /// create a dryrun job to do necessary check before actual creation /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name Linker 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). + /// The name of dryrun. + /// Json string supplied to the LinkersCreateDryrun operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LinkerListConfigurations(string resourceUri, string linkerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LinkersCreateDryrunViaJsonStringWithResult(string resourceUri, string dryrunName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -3740,113 +8925,212 @@ public partial class ServiceLinker var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (resourceUri) - + "/providers/Microsoft.ServiceLinker/linkers/" - + global::System.Uri.EscapeDataString(linkerName) - + "/listConfigurations" + + "/providers/Microsoft.ServiceLinker/dryruns/" + + global::System.Uri.EscapeDataString(dryrunName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.LinkerListConfigurations_Call(request,onOk,onDefault,eventListener,sender); + return await this.LinkersCreateDryrunWithResult_Call (request, eventListener,sender); } } - /// list source configurations for a Linker. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// create a dryrun job to do necessary check before actual creation + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name of dryrun. + /// dryrun resource. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LinkerListConfigurationsViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LinkersCreateDryrunWithResult(string resourceUri, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/linkers/(?[^/]+)/listConfigurations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/listConfigurations'"); - } - - // replace URI parameters with values from identity - var resourceUri = _match.Groups["resourceUri"].Value; - var linkerName = _match.Groups["linkerName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + resourceUri - + "/providers/Microsoft.ServiceLinker/linkers/" - + linkerName - + "/listConfigurations" + + (resourceUri) + + "/providers/Microsoft.ServiceLinker/dryruns/" + + global::System.Uri.EscapeDataString(dryrunName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.LinkerListConfigurations_Call(request,onOk,onDefault,eventListener,sender); + return await this.LinkersCreateDryrunWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task LinkerListConfigurations_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LinkersCreateDryrunWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) { case global::System.Net.HttpStatusCode.OK: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } default: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } } } @@ -3860,77 +9144,7 @@ public partial class ServiceLinker } } - /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. - /// - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name Linker 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 LinkerListConfigurations_Validate(string resourceUri, string linkerName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(resourceUri),resourceUri); - await eventListener.AssertNotNull(nameof(linkerName),linkerName); - } - } - - /// - /// Returns list of Linkers which connects to the resource. which supports to config both application and target service during - /// the resource provision. - /// - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task LinkerListViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) - { - var apiVersion = @"2022-11-01-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/linkers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers'"); - } - - // replace URI parameters with values from identity - var resourceUri = _match.Groups["resourceUri"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + resourceUri - + "/providers/Microsoft.ServiceLinker/linkers" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LinkerList_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -3940,17 +9154,110 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task LinkerList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LinkersCreateDryrun_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3958,13 +9265,13 @@ public partial class ServiceLinker case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ResourceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3980,28 +9287,32 @@ public partial class ServiceLinker } /// - /// Validation method for method. Call this like the actual call, but you will get validation events - /// back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name of dryrun. + /// dryrun 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 LinkerList_Validate(string resourceUri, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task LinkersCreateDryrun_Validate(string resourceUri, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(resourceUri),resourceUri); + await eventListener.AssertNotNull(nameof(dryrunName),dryrunName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Operation to update an existing Linker. + /// delete a dryrun job /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name Linker resource. - /// - /// Linker details. + /// The name of dryrun. /// 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. @@ -4009,7 +9320,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LinkerUpdate(string resourceUri, string linkerName, string xMSServiceconnectorUserToken, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LinkersDeleteDryrun(string resourceUri, string dryrunName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -4019,8 +9330,8 @@ public partial class ServiceLinker var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (resourceUri) - + "/providers/Microsoft.ServiceLinker/linkers/" - + global::System.Uri.EscapeDataString(linkerName) + + "/providers/Microsoft.ServiceLinker/dryruns/" + + global::System.Uri.EscapeDataString(dryrunName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4029,30 +9340,19 @@ public partial class ServiceLinker // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != xMSServiceconnectorUserToken) - { - request.Headers.Add("x-ms-serviceconnector-user-token",xMSServiceconnectorUserToken); - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.LinkerUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.LinkersDeleteDryrun_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Operation to update an existing Linker. + /// delete a dryrun job /// - /// - /// Linker details. /// 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. @@ -4060,7 +9360,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LinkerUpdateViaIdentity(global::System.String viaIdentity, string xMSServiceconnectorUserToken, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LinkersDeleteDryrunViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -4068,21 +9368,21 @@ public partial class ServiceLinker { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/linkers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/dryruns/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'"); + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}'"); } // replace URI parameters with values from identity var resourceUri = _match.Groups["resourceUri"].Value; - var linkerName = _match.Groups["linkerName"].Value; + var dryrunName = _match.Groups["dryrunName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + resourceUri - + "/providers/Microsoft.ServiceLinker/linkers/" - + linkerName + + "/providers/Microsoft.ServiceLinker/dryruns/" + + dryrunName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4091,28 +9391,19 @@ public partial class ServiceLinker // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != xMSServiceconnectorUserToken) - { - request.Headers.Add("x-ms-serviceconnector-user-token",xMSServiceconnectorUserToken); - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.LinkerUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.LinkersDeleteDryrun_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -4120,7 +9411,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task LinkerUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LinkersDeleteDryrun_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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -4131,102 +9422,7 @@ public partial class ServiceLinker await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.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.ServiceLinker.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.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -4234,13 +9430,19 @@ public partial class ServiceLinker case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4256,41 +9458,38 @@ public partial class ServiceLinker } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name Linker resource. - /// - /// Linker details. + /// The name of dryrun. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task LinkerUpdate_Validate(string resourceUri, string linkerName, string xMSServiceconnectorUserToken, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatch body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task LinkersDeleteDryrun_Validate(string resourceUri, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(resourceUri),resourceUri); - await eventListener.AssertNotNull(nameof(linkerName),linkerName); - await eventListener.AssertNotNull(nameof(xMSServiceconnectorUserToken),xMSServiceconnectorUserToken); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertNotNull(nameof(dryrunName),dryrunName); } } - /// Validate a Linker. + /// Generate configurations for a Linker. /// The fully qualified Azure Resource manager identifier of the resource to be connected. /// The name Linker resource. + /// Connection Info, including format, secret store, etc /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LinkerValidate(string resourceUri, string linkerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LinkersGenerateConfigurations(string resourceUri, string linkerName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -4302,7 +9501,7 @@ public partial class ServiceLinker + (resourceUri) + "/providers/Microsoft.ServiceLinker/linkers/" + global::System.Uri.EscapeDataString(linkerName) - + "/validateLinker" + + "/generateConfigurations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4315,22 +9514,28 @@ public partial class ServiceLinker await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.LinkerValidate_Call(request,onOk,onDefault,eventListener,sender); + await this.LinkersGenerateConfigurations_Call (request, onOk,onDefault,eventListener,sender); } } - /// Validate a Linker. + /// Generate configurations for a Linker. /// + /// Connection Info, including format, secret store, etc /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LinkerValidateViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LinkersGenerateConfigurationsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -4338,10 +9543,10 @@ public partial class ServiceLinker { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/linkers/(?[^/]+)/validateLinker$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/linkers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker'"); + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'"); } // replace URI parameters with values from identity @@ -4353,7 +9558,7 @@ public partial class ServiceLinker + resourceUri + "/providers/Microsoft.ServiceLinker/linkers/" + linkerName - + "/validateLinker" + + "/generateConfigurations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4366,189 +9571,127 @@ public partial class ServiceLinker await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.LinkerValidate_Call(request,onOk,onDefault,eventListener,sender); + await this.LinkersGenerateConfigurations_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). + /// Generate configurations for a Linker. + /// + /// Connection Info, including format, secret store, etc /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task LinkerValidate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LinkersGenerateConfigurationsViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.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.ServiceLinker.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.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // verify that Identity format is an exact match for uri - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.UndeclaredResponseException(_response); - } - } + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/linkers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}'"); + } - // 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.ServiceLinker.Runtime.Method.Get); + // replace URI parameters with values from identity + var resourceUri = _match.Groups["resourceUri"].Value; + var linkerName = _match.Groups["linkerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceUri + + "/providers/Microsoft.ServiceLinker/linkers/" + + linkerName + + "/generateConfigurations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ValidateOperationResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LinkersGenerateConfigurationsWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// + /// Generate configurations for a Linker. /// The fully qualified Azure Resource manager identifier of the resource to be connected. /// The name Linker resource. + /// Json string supplied to the LinkersGenerateConfigurations 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.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task LinkerValidate_Validate(string resourceUri, string linkerName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task LinkersGenerateConfigurationsViaJsonString(string resourceUri, string linkerName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(resourceUri),resourceUri); - await eventListener.AssertNotNull(nameof(linkerName),linkerName); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceUri) + + "/providers/Microsoft.ServiceLinker/linkers/" + + global::System.Uri.EscapeDataString(linkerName) + + "/generateConfigurations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LinkersGenerateConfigurations_Call (request, onOk,onDefault,eventListener,sender); } } - /// create a dryrun job to do necessary check before actual creation + /// Generate configurations for a Linker. /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name of dryrun. - /// dryrun 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). + /// The name Linker resource. + /// Json string supplied to the LinkersGenerateConfigurations operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LinkersCreateDryrun(string resourceUri, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LinkersGenerateConfigurationsViaJsonStringWithResult(string resourceUri, string linkerName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -4558,85 +9701,138 @@ public partial class ServiceLinker var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (resourceUri) - + "/providers/Microsoft.ServiceLinker/dryruns/" - + global::System.Uri.EscapeDataString(dryrunName) + + "/providers/Microsoft.ServiceLinker/linkers/" + + global::System.Uri.EscapeDataString(linkerName) + + "/generateConfigurations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.LinkersCreateDryrun_Call(request,onOk,onDefault,eventListener,sender); + return await this.LinkersGenerateConfigurationsWithResult_Call (request, eventListener,sender); } } - /// create a dryrun job to do necessary check before actual creation - /// - /// dryrun 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). + /// Generate configurations for a Linker. + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name Linker resource. + /// Connection Info, including format, secret store, etc /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LinkersCreateDryrunViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LinkersGenerateConfigurationsWithResult(string resourceUri, string linkerName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/dryruns/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}'"); - } - - // replace URI parameters with values from identity - var resourceUri = _match.Groups["resourceUri"].Value; - var dryrunName = _match.Groups["dryrunName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + resourceUri - + "/providers/Microsoft.ServiceLinker/dryruns/" - + dryrunName + + (resourceUri) + + "/providers/Microsoft.ServiceLinker/linkers/" + + global::System.Uri.EscapeDataString(linkerName) + + "/generateConfigurations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LinkersGenerateConfigurationsWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LinkersGenerateConfigurationsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LinkersCreateDryrun_Call(request,onOk,onDefault,eventListener,sender); + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -4646,7 +9842,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task LinkersCreateDryrun_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LinkersGenerateConfigurations_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -4657,102 +9853,7 @@ public partial class ServiceLinker await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.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.ServiceLinker.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.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -4760,13 +9861,13 @@ public partial class ServiceLinker case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4782,32 +9883,31 @@ public partial class ServiceLinker } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name of dryrun. - /// dryrun resource. + /// The name Linker resource. + /// Connection Info, including format, secret store, etc /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task LinkersCreateDryrun_Validate(string resourceUri, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task LinkersGenerateConfigurations_Validate(string resourceUri, string linkerName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(resourceUri),resourceUri); - await eventListener.AssertNotNull(nameof(dryrunName),dryrunName); + await eventListener.AssertNotNull(nameof(linkerName),linkerName); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// delete a dryrun job + /// get a dryrun job /// The fully qualified Azure Resource manager identifier of the resource to be connected. /// The name of dryrun. /// 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. @@ -4815,7 +9915,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LinkersDeleteDryrun(string resourceUri, string dryrunName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LinkersGetDryrun(string resourceUri, string dryrunName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -4835,19 +9935,18 @@ public partial class ServiceLinker // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.LinkersDeleteDryrun_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.LinkersGetDryrun_Call (request, onOk,onDefault,eventListener,sender); } } - /// delete a dryrun job + /// get a dryrun job /// /// 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. @@ -4855,7 +9954,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LinkersDeleteDryrunViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LinkersGetDryrunViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -4886,103 +9985,73 @@ public partial class ServiceLinker // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.LinkersDeleteDryrun_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.LinkersGetDryrun_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// get a dryrun job + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task LinkersDeleteDryrun_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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LinkersGetDryrunViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/dryruns/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name of dryrun. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task LinkersDeleteDryrun_Validate(string resourceUri, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(resourceUri),resourceUri); - await eventListener.AssertNotNull(nameof(dryrunName),dryrunName); + // replace URI parameters with values from identity + var resourceUri = _match.Groups["resourceUri"].Value; + var dryrunName = _match.Groups["dryrunName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceUri + + "/providers/Microsoft.ServiceLinker/dryruns/" + + dryrunName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LinkersGetDryrunWithResult_Call (request, eventListener,sender); } } - /// Generate configurations for a Linker. + /// get a dryrun job /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name Linker resource. - /// Connection Info, including format, secret store, etc - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// The name of dryrun. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LinkersGenerateConfigurations(string resourceUri, string linkerName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LinkersGetDryrunWithResult(string resourceUri, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -4992,87 +10061,86 @@ public partial class ServiceLinker var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (resourceUri) - + "/providers/Microsoft.ServiceLinker/linkers/" - + global::System.Uri.EscapeDataString(linkerName) - + "/generateConfigurations" + + "/providers/Microsoft.ServiceLinker/dryruns/" + + global::System.Uri.EscapeDataString(dryrunName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.LinkersGenerateConfigurations_Call(request,onOk,onDefault,eventListener,sender); + return await this.LinkersGetDryrunWithResult_Call (request, eventListener,sender); } } - /// Generate configurations for a Linker. - /// - /// Connection Info, including format, secret store, etc - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LinkersGenerateConfigurationsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LinkersGetDryrunWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { - var apiVersion = @"2022-11-01-preview"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/linkers/(?[^/]+)/generateConfigurations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + global::System.Net.Http.HttpResponseMessage _response = null; + try { - throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/generateConfigurations'"); - } - - // replace URI parameters with values from identity - var resourceUri = _match.Groups["resourceUri"].Value; - var linkerName = _match.Groups["linkerName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + resourceUri - + "/providers/Microsoft.ServiceLinker/linkers/" - + linkerName - + "/generateConfigurations" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LinkersGenerateConfigurations_Call(request,onOk,onDefault,eventListener,sender); + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -5082,7 +10150,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task LinkersGenerateConfigurations_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LinkersGetDryrun_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -5093,6 +10161,7 @@ public partial class ServiceLinker await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -5100,13 +10169,13 @@ public partial class ServiceLinker case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -5122,30 +10191,26 @@ public partial class ServiceLinker } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name Linker resource. - /// Connection Info, including format, secret store, etc + /// The name of dryrun. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task LinkersGenerateConfigurations_Validate(string resourceUri, string linkerName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task LinkersGetDryrun_Validate(string resourceUri, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(resourceUri),resourceUri); - await eventListener.AssertNotNull(nameof(linkerName),linkerName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertNotNull(nameof(dryrunName),dryrunName); } } - /// get a dryrun job + /// list dryrun jobs /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name of dryrun. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -5154,7 +10219,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LinkersGetDryrun(string resourceUri, string dryrunName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LinkersListDryrun(string resourceUri, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -5164,8 +10229,7 @@ public partial class ServiceLinker var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (resourceUri) - + "/providers/Microsoft.ServiceLinker/dryruns/" - + global::System.Uri.EscapeDataString(dryrunName) + + "/providers/Microsoft.ServiceLinker/dryruns" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5179,11 +10243,11 @@ public partial class ServiceLinker await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.LinkersGetDryrun_Call(request,onOk,onDefault,eventListener,sender); + await this.LinkersListDryrun_Call (request, onOk,onDefault,eventListener,sender); } } - /// get a dryrun job + /// list dryrun jobs /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -5193,7 +10257,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LinkersGetDryrunViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LinkersListDryrunViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -5201,21 +10265,19 @@ public partial class ServiceLinker { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/dryruns/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/dryruns$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}'"); + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns'"); } // replace URI parameters with values from identity var resourceUri = _match.Groups["resourceUri"].Value; - var dryrunName = _match.Groups["dryrunName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + resourceUri - + "/providers/Microsoft.ServiceLinker/dryruns/" - + dryrunName + + "/providers/Microsoft.ServiceLinker/dryruns" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5229,11 +10291,153 @@ public partial class ServiceLinker await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.LinkersGetDryrun_Call(request,onOk,onDefault,eventListener,sender); + await this.LinkersListDryrun_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// list dryrun jobs + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkersListDryrunViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/dryruns$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns'"); + } + + // replace URI parameters with values from identity + var resourceUri = _match.Groups["resourceUri"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceUri + + "/providers/Microsoft.ServiceLinker/dryruns" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LinkersListDryrunWithResult_Call (request, eventListener,sender); + } + } + + /// list dryrun jobs + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkersListDryrunWithResult(string resourceUri, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceUri) + + "/providers/Microsoft.ServiceLinker/dryruns" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LinkersListDryrunWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LinkersListDryrunWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -5243,7 +10447,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task LinkersGetDryrun_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LinkersListDryrun_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -5254,6 +10458,7 @@ public partial class ServiceLinker await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -5261,13 +10466,13 @@ public partial class ServiceLinker case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -5283,35 +10488,36 @@ public partial class ServiceLinker } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// The name of dryrun. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task LinkersGetDryrun_Validate(string resourceUri, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task LinkersListDryrun_Validate(string resourceUri, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(resourceUri),resourceUri); - await eventListener.AssertNotNull(nameof(dryrunName),dryrunName); } } - /// list dryrun jobs + /// add a dryrun job to do necessary check before actual creation /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name of dryrun. + /// dryrun 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.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LinkersListDryrun(string resourceUri, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LinkersUpdateDryrun(string resourceUri, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -5321,7 +10527,8 @@ public partial class ServiceLinker var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (resourceUri) - + "/providers/Microsoft.ServiceLinker/dryruns" + + "/providers/Microsoft.ServiceLinker/dryruns/" + + global::System.Uri.EscapeDataString(dryrunName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5330,26 +10537,32 @@ public partial class ServiceLinker // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.LinkersListDryrun_Call(request,onOk,onDefault,eventListener,sender); + await this.LinkersUpdateDryrun_Call (request, onOk,onDefault,eventListener,sender); } } - /// list dryrun jobs + /// add a dryrun job to do necessary check before actual creation /// + /// dryrun 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.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LinkersListDryrunViaIdentity(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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LinkersUpdateDryrunViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -5357,19 +10570,21 @@ public partial class ServiceLinker { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/dryruns$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/dryruns/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns'"); + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}'"); } // replace URI parameters with values from identity var resourceUri = _match.Groups["resourceUri"].Value; + var dryrunName = _match.Groups["dryrunName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + resourceUri - + "/providers/Microsoft.ServiceLinker/dryruns" + + "/providers/Microsoft.ServiceLinker/dryruns/" + + dryrunName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5378,85 +10593,77 @@ public partial class ServiceLinker // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.LinkersListDryrun_Call(request,onOk,onDefault,eventListener,sender); + await this.LinkersUpdateDryrun_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). + /// add a dryrun job to do necessary check before actual creation + /// + /// dryrun resource. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task LinkersListDryrun_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LinkersUpdateDryrunViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatch body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/dryruns/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task LinkersListDryrun_Validate(string resourceUri, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(resourceUri),resourceUri); + // replace URI parameters with values from identity + var resourceUri = _match.Groups["resourceUri"].Value; + var dryrunName = _match.Groups["dryrunName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceUri + + "/providers/Microsoft.ServiceLinker/dryruns/" + + dryrunName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LinkersUpdateDryrunWithResult_Call (request, eventListener,sender); } } /// add a dryrun job to do necessary check before actual creation /// The fully qualified Azure Resource manager identifier of the resource to be connected. /// The name of dryrun. - /// dryrun resource. + /// Json string supplied to the LinkersUpdateDryrun 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). @@ -5465,7 +10672,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LinkersUpdateDryrun(string resourceUri, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LinkersUpdateDryrunViaJsonString(string resourceUri, string dryrunName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -5490,70 +10697,254 @@ public partial class ServiceLinker await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.LinkersUpdateDryrun_Call(request,onOk,onDefault,eventListener,sender); + await this.LinkersUpdateDryrun_Call (request, onOk,onDefault,eventListener,sender); } } /// add a dryrun job to do necessary check before actual creation - /// - /// dryrun 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). + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name of dryrun. + /// Json string supplied to the LinkersUpdateDryrun operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LinkersUpdateDryrunViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LinkersUpdateDryrunViaJsonStringWithResult(string resourceUri, string dryrunName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceUri) + + "/providers/Microsoft.ServiceLinker/dryruns/" + + global::System.Uri.EscapeDataString(dryrunName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.ServiceLinker/dryruns/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}'"); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // replace URI parameters with values from identity - var resourceUri = _match.Groups["resourceUri"].Value; - var dryrunName = _match.Groups["dryrunName"].Value; + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LinkersUpdateDryrunWithResult_Call (request, eventListener,sender); + } + } + + /// add a dryrun job to do necessary check before actual creation + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The name of dryrun. + /// dryrun resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LinkersUpdateDryrunWithResult(string resourceUri, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatch body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + resourceUri + + (resourceUri) + "/providers/Microsoft.ServiceLinker/dryruns/" - + dryrunName + + global::System.Uri.EscapeDataString(dryrunName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.LinkersUpdateDryrun_Call(request,onOk,onDefault,eventListener,sender); + return await this.LinkersUpdateDryrunWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LinkersUpdateDryrunWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -5563,31 +10954,28 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task LinkersUpdateDryrun_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LinkersUpdateDryrun_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: azure-async-operation var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -5596,15 +10984,14 @@ public partial class ServiceLinker if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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(); @@ -5613,45 +11000,45 @@ public partial class ServiceLinker _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -5670,6 +11057,7 @@ public partial class ServiceLinker await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -5677,13 +11065,13 @@ public partial class ServiceLinker case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -5709,7 +11097,7 @@ public partial class ServiceLinker /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task LinkersUpdateDryrun_Validate(string resourceUri, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatch body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task LinkersUpdateDryrun_Validate(string resourceUri, string dryrunName, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatch body, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -5729,7 +11117,7 @@ public partial class ServiceLinker /// /// 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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -5751,7 +11139,7 @@ public partial class ServiceLinker await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); + await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); } } @@ -5765,7 +11153,7 @@ public partial class ServiceLinker /// /// 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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01-preview"; // Constant Parameters @@ -5796,11 +11184,147 @@ public partial class ServiceLinker await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); + await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Lists the available ServiceLinker REST API operations. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.ServiceLinker/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.ServiceLinker/operations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.ServiceLinker/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OperationsListWithResult_Call (request, eventListener,sender); + } + } + + /// Lists the available ServiceLinker REST API operations. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsListWithResult(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.ServiceLinker/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OperationsListWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -5810,7 +11334,7 @@ public partial class ServiceLinker /// /// 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.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task OperationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -5821,6 +11345,7 @@ public partial class ServiceLinker await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -5828,13 +11353,13 @@ public partial class ServiceLinker case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AccessKeyPermissions.Completer.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AccessKeyPermissions.Completer.cs deleted file mode 100644 index 1e718ed9ff3f..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AccessKeyPermissions.Completer.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// Argument completer implementation for AccessKeyPermissions. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AccessKeyPermissionsTypeConverter))] - public partial struct AccessKeyPermissions : - 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) || "Read".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Read'", "Read", global::System.Management.Automation.CompletionResultType.ParameterValue, "Read"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Write".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Write'", "Write", global::System.Management.Automation.CompletionResultType.ParameterValue, "Write"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Listen".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Listen'", "Listen", global::System.Management.Automation.CompletionResultType.ParameterValue, "Listen"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Send".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Send'", "Send", global::System.Management.Automation.CompletionResultType.ParameterValue, "Send"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Manage".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Manage'", "Manage", global::System.Management.Automation.CompletionResultType.ParameterValue, "Manage"); - } - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AccessKeyPermissions.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AccessKeyPermissions.TypeConverter.cs deleted file mode 100644 index 2426e694ea93..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AccessKeyPermissions.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// TypeConverter implementation for AccessKeyPermissions. - public partial class AccessKeyPermissionsTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => AccessKeyPermissions.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AccessKeyPermissions.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AccessKeyPermissions.cs deleted file mode 100644 index e87f9f76fae8..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AccessKeyPermissions.cs +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - public partial struct AccessKeyPermissions : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AccessKeyPermissions Listen = @"Listen"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AccessKeyPermissions Manage = @"Manage"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AccessKeyPermissions Read = @"Read"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AccessKeyPermissions Send = @"Send"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AccessKeyPermissions Write = @"Write"; - - /// 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 AccessKeyPermissions(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AccessKeyPermissions - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AccessKeyPermissions(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AccessKeyPermissions - /// 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.ServiceLinker.Support.AccessKeyPermissions e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type AccessKeyPermissions (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 AccessKeyPermissions && Equals((AccessKeyPermissions)obj); - } - - /// Returns hashCode for enum AccessKeyPermissions - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AccessKeyPermissions - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AccessKeyPermissions - /// the value to convert to an instance of . - - public static implicit operator AccessKeyPermissions(string value) - { - return new AccessKeyPermissions(value); - } - - /// Implicit operator to convert AccessKeyPermissions to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AccessKeyPermissions e) - { - return e._value; - } - - /// Overriding != operator for enum AccessKeyPermissions - /// 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.ServiceLinker.Support.AccessKeyPermissions e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AccessKeyPermissions e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AccessKeyPermissions - /// 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.ServiceLinker.Support.AccessKeyPermissions e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AccessKeyPermissions e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ActionType.Completer.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ActionType.Completer.cs deleted file mode 100644 index 8857f70b68de..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ActionType.Completer.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// - /// Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionTypeTypeConverter))] - public partial struct ActionType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Internal".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Internal'", "Internal", global::System.Management.Automation.CompletionResultType.ParameterValue, "Internal"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "enable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'enable'", "enable", global::System.Management.Automation.CompletionResultType.ParameterValue, "enable"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "optOut".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'optOut'", "optOut", global::System.Management.Automation.CompletionResultType.ParameterValue, "optOut"); - } - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ActionType.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ActionType.TypeConverter.cs deleted file mode 100644 index cf23d16f459b..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ActionType.TypeConverter.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// - /// Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - /// - public partial class ActionTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ActionType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ActionType.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ActionType.cs deleted file mode 100644 index 4954168ace78..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ActionType.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// - /// Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - /// - public partial struct ActionType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType Enable = @"enable"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType Internal = @"Internal"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType OptOut = @"optOut"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private ActionType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ActionType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ActionType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ActionType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ActionType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is ActionType && Equals((ActionType)obj); - } - - /// Returns hashCode for enum ActionType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ActionType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ActionType - /// the value to convert to an instance of . - - public static implicit operator ActionType(string value) - { - return new ActionType(value); - } - - /// Implicit operator to convert ActionType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType e) - { - return e._value; - } - - /// Overriding != operator for enum ActionType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ActionType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AllowType.Completer.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AllowType.Completer.cs deleted file mode 100644 index 45d50d808cff..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AllowType.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// Whether to allow firewall rules. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowTypeTypeConverter))] - public partial struct AllowType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "true".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'true'", "true", global::System.Management.Automation.CompletionResultType.ParameterValue, "true"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "false".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'false'", "false", global::System.Management.Automation.CompletionResultType.ParameterValue, "false"); - } - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AllowType.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AllowType.TypeConverter.cs deleted file mode 100644 index ae47f856a60a..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AllowType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// Whether to allow firewall rules. - public partial class AllowTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => AllowType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AllowType.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AllowType.cs deleted file mode 100644 index 17206ee283e5..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AllowType.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// Whether to allow firewall rules. - public partial struct AllowType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType False = @"false"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType True = @"true"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private AllowType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AllowType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AllowType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AllowType - /// 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.ServiceLinker.Support.AllowType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type AllowType (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 AllowType && Equals((AllowType)obj); - } - - /// Returns hashCode for enum AllowType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AllowType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AllowType - /// the value to convert to an instance of . - - public static implicit operator AllowType(string value) - { - return new AllowType(value); - } - - /// Implicit operator to convert AllowType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType e) - { - return e._value; - } - - /// Overriding != operator for enum AllowType - /// 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.ServiceLinker.Support.AllowType e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AllowType - /// 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.ServiceLinker.Support.AllowType e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AuthType.Completer.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AuthType.Completer.cs deleted file mode 100644 index c373a3eafd92..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AuthType.Completer.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// The authentication type. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthTypeTypeConverter))] - public partial struct AuthType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "systemAssignedIdentity".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'systemAssignedIdentity'", "systemAssignedIdentity", global::System.Management.Automation.CompletionResultType.ParameterValue, "systemAssignedIdentity"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "userAssignedIdentity".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'userAssignedIdentity'", "userAssignedIdentity", global::System.Management.Automation.CompletionResultType.ParameterValue, "userAssignedIdentity"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "servicePrincipalSecret".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'servicePrincipalSecret'", "servicePrincipalSecret", global::System.Management.Automation.CompletionResultType.ParameterValue, "servicePrincipalSecret"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "servicePrincipalCertificate".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'servicePrincipalCertificate'", "servicePrincipalCertificate", global::System.Management.Automation.CompletionResultType.ParameterValue, "servicePrincipalCertificate"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "secret".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'secret'", "secret", global::System.Management.Automation.CompletionResultType.ParameterValue, "secret"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "accessKey".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'accessKey'", "accessKey", global::System.Management.Automation.CompletionResultType.ParameterValue, "accessKey"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "userAccount".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'userAccount'", "userAccount", global::System.Management.Automation.CompletionResultType.ParameterValue, "userAccount"); - } - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AuthType.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AuthType.TypeConverter.cs deleted file mode 100644 index e737e03ef164..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AuthType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// The authentication type. - public partial class AuthTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => AuthType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AuthType.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AuthType.cs deleted file mode 100644 index 143e7ba19b87..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/AuthType.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// The authentication type. - public partial struct AuthType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType AccessKey = @"accessKey"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType Secret = @"secret"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType ServicePrincipalCertificate = @"servicePrincipalCertificate"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType ServicePrincipalSecret = @"servicePrincipalSecret"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType SystemAssignedIdentity = @"systemAssignedIdentity"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType UserAccount = @"userAccount"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType UserAssignedIdentity = @"userAssignedIdentity"; - - /// 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 AuthType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AuthType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AuthType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AuthType - /// 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.ServiceLinker.Support.AuthType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type AuthType (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 AuthType && Equals((AuthType)obj); - } - - /// Returns hashCode for enum AuthType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AuthType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AuthType - /// the value to convert to an instance of . - - public static implicit operator AuthType(string value) - { - return new AuthType(value); - } - - /// Implicit operator to convert AuthType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType e) - { - return e._value; - } - - /// Overriding != operator for enum AuthType - /// 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.ServiceLinker.Support.AuthType e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AuthType - /// 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.ServiceLinker.Support.AuthType e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AuthType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ClientType.Completer.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ClientType.Completer.cs deleted file mode 100644 index 413a75b1d9bd..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ClientType.Completer.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// The application client type - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientTypeTypeConverter))] - public partial struct ClientType : - 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) || "dotnet".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'dotnet'", "dotnet", global::System.Management.Automation.CompletionResultType.ParameterValue, "dotnet"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "java".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'java'", "java", global::System.Management.Automation.CompletionResultType.ParameterValue, "java"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "python".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'python'", "python", global::System.Management.Automation.CompletionResultType.ParameterValue, "python"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "go".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'go'", "go", global::System.Management.Automation.CompletionResultType.ParameterValue, "go"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "php".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'php'", "php", global::System.Management.Automation.CompletionResultType.ParameterValue, "php"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ruby".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ruby'", "ruby", global::System.Management.Automation.CompletionResultType.ParameterValue, "ruby"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "django".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'django'", "django", global::System.Management.Automation.CompletionResultType.ParameterValue, "django"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "nodejs".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'nodejs'", "nodejs", global::System.Management.Automation.CompletionResultType.ParameterValue, "nodejs"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "springBoot".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'springBoot'", "springBoot", global::System.Management.Automation.CompletionResultType.ParameterValue, "springBoot"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "kafka-springBoot".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'kafka-springBoot'", "kafka-springBoot", global::System.Management.Automation.CompletionResultType.ParameterValue, "kafka-springBoot"); - } - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ClientType.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ClientType.TypeConverter.cs deleted file mode 100644 index 157182c89abb..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ClientType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// The application client type - public partial class ClientTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => ClientType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ClientType.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ClientType.cs deleted file mode 100644 index 923fa91eda47..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ClientType.cs +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// The application client type - public partial struct ClientType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType Django = @"django"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType Dotnet = @"dotnet"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType Go = @"go"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType Java = @"java"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType KafkaSpringBoot = @"kafka-springBoot"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType Nodejs = @"nodejs"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType None = @"none"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType Php = @"php"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType Python = @"python"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType Ruby = @"ruby"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType SpringBoot = @"springBoot"; - - /// 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 ClientType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ClientType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ClientType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ClientType - /// 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.ServiceLinker.Support.ClientType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ClientType (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 ClientType && Equals((ClientType)obj); - } - - /// Returns hashCode for enum ClientType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ClientType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ClientType - /// the value to convert to an instance of . - - public static implicit operator ClientType(string value) - { - return new ClientType(value); - } - - /// Implicit operator to convert ClientType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType e) - { - return e._value; - } - - /// Overriding != operator for enum ClientType - /// 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.ServiceLinker.Support.ClientType e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ClientType - /// 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.ServiceLinker.Support.ClientType e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/CreatedByType.Completer.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/CreatedByType.Completer.cs deleted file mode 100644 index 7cc0512faa09..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/CreatedByType.Completer.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// The type of identity that created the resource. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByTypeTypeConverter))] - public partial struct CreatedByType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "User".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'User'", "User", global::System.Management.Automation.CompletionResultType.ParameterValue, "User"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Application".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Application'", "Application", global::System.Management.Automation.CompletionResultType.ParameterValue, "Application"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ManagedIdentity".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ManagedIdentity'", "ManagedIdentity", global::System.Management.Automation.CompletionResultType.ParameterValue, "ManagedIdentity"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Key".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Key'", "Key", global::System.Management.Automation.CompletionResultType.ParameterValue, "Key"); - } - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs deleted file mode 100644 index 25f71dea9add..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// The type of identity that created the resource. - public partial class CreatedByTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => CreatedByType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/CreatedByType.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/CreatedByType.cs deleted file mode 100644 index 0f9e7bf3e93b..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/CreatedByType.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// The type of identity that created the resource. - public partial struct CreatedByType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType Application = @"Application"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType Key = @"Key"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType ManagedIdentity = @"ManagedIdentity"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.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.ServiceLinker.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.ServiceLinker.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.CreatedByType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DeleteOrUpdateBehavior.Completer.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DeleteOrUpdateBehavior.Completer.cs deleted file mode 100644 index 6e8e946e5a25..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DeleteOrUpdateBehavior.Completer.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// - /// The cleanup behavior to indicate whether clean up operation when resource is deleted or updated - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehaviorTypeConverter))] - public partial struct DeleteOrUpdateBehavior : - 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) || "Default".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Default'", "Default", global::System.Management.Automation.CompletionResultType.ParameterValue, "Default"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ForcedCleanup".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ForcedCleanup'", "ForcedCleanup", global::System.Management.Automation.CompletionResultType.ParameterValue, "ForcedCleanup"); - } - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DeleteOrUpdateBehavior.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DeleteOrUpdateBehavior.TypeConverter.cs deleted file mode 100644 index 9ec0b8a0fc2b..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DeleteOrUpdateBehavior.TypeConverter.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// - /// The cleanup behavior to indicate whether clean up operation when resource is deleted or updated - /// - public partial class DeleteOrUpdateBehaviorTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => DeleteOrUpdateBehavior.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DeleteOrUpdateBehavior.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DeleteOrUpdateBehavior.cs deleted file mode 100644 index 54aaeac4261d..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DeleteOrUpdateBehavior.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// - /// The cleanup behavior to indicate whether clean up operation when resource is deleted or updated - /// - public partial struct DeleteOrUpdateBehavior : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior Default = @"Default"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior ForcedCleanup = @"ForcedCleanup"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to DeleteOrUpdateBehavior - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new DeleteOrUpdateBehavior(global::System.Convert.ToString(value)); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private DeleteOrUpdateBehavior(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Compares values of enum type DeleteOrUpdateBehavior - /// 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.ServiceLinker.Support.DeleteOrUpdateBehavior e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type DeleteOrUpdateBehavior (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 DeleteOrUpdateBehavior && Equals((DeleteOrUpdateBehavior)obj); - } - - /// Returns hashCode for enum DeleteOrUpdateBehavior - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for DeleteOrUpdateBehavior - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to DeleteOrUpdateBehavior - /// the value to convert to an instance of . - - public static implicit operator DeleteOrUpdateBehavior(string value) - { - return new DeleteOrUpdateBehavior(value); - } - - /// Implicit operator to convert DeleteOrUpdateBehavior to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior e) - { - return e._value; - } - - /// Overriding != operator for enum DeleteOrUpdateBehavior - /// 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.ServiceLinker.Support.DeleteOrUpdateBehavior e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum DeleteOrUpdateBehavior - /// 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.ServiceLinker.Support.DeleteOrUpdateBehavior e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DryrunPrerequisiteResultType.Completer.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DryrunPrerequisiteResultType.Completer.cs deleted file mode 100644 index fedc33f4f6ef..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DryrunPrerequisiteResultType.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// The type of dryrun result. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPrerequisiteResultTypeTypeConverter))] - public partial struct DryrunPrerequisiteResultType : - 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) || "basicError".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'basicError'", "basicError", global::System.Management.Automation.CompletionResultType.ParameterValue, "basicError"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "permissionsMissing".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'permissionsMissing'", "permissionsMissing", global::System.Management.Automation.CompletionResultType.ParameterValue, "permissionsMissing"); - } - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DryrunPrerequisiteResultType.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DryrunPrerequisiteResultType.TypeConverter.cs deleted file mode 100644 index 6ad22da0fc20..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DryrunPrerequisiteResultType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// The type of dryrun result. - public partial class DryrunPrerequisiteResultTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => DryrunPrerequisiteResultType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DryrunPrerequisiteResultType.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DryrunPrerequisiteResultType.cs deleted file mode 100644 index 4b4b6e5e6f9e..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DryrunPrerequisiteResultType.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// The type of dryrun result. - public partial struct DryrunPrerequisiteResultType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPrerequisiteResultType BasicError = @"basicError"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPrerequisiteResultType PermissionsMissing = @"permissionsMissing"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to DryrunPrerequisiteResultType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new DryrunPrerequisiteResultType(global::System.Convert.ToString(value)); - } - - /// - /// Creates an instance of the Enum class. - /// - /// the value to create an instance for. - private DryrunPrerequisiteResultType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Compares values of enum type DryrunPrerequisiteResultType - /// 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.ServiceLinker.Support.DryrunPrerequisiteResultType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type DryrunPrerequisiteResultType (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 DryrunPrerequisiteResultType && Equals((DryrunPrerequisiteResultType)obj); - } - - /// Returns hashCode for enum DryrunPrerequisiteResultType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for DryrunPrerequisiteResultType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to DryrunPrerequisiteResultType - /// the value to convert to an instance of . - - public static implicit operator DryrunPrerequisiteResultType(string value) - { - return new DryrunPrerequisiteResultType(value); - } - - /// Implicit operator to convert DryrunPrerequisiteResultType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPrerequisiteResultType e) - { - return e._value; - } - - /// Overriding != operator for enum DryrunPrerequisiteResultType - /// 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.ServiceLinker.Support.DryrunPrerequisiteResultType e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPrerequisiteResultType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum DryrunPrerequisiteResultType - /// 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.ServiceLinker.Support.DryrunPrerequisiteResultType e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPrerequisiteResultType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DryrunPreviewOperationType.Completer.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DryrunPreviewOperationType.Completer.cs deleted file mode 100644 index cdf0b826c34a..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DryrunPreviewOperationType.Completer.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// The operation type - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPreviewOperationTypeTypeConverter))] - public partial struct DryrunPreviewOperationType : - 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) || "configConnection".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'configConnection'", "configConnection", global::System.Management.Automation.CompletionResultType.ParameterValue, "configConnection"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "configNetwork".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'configNetwork'", "configNetwork", global::System.Management.Automation.CompletionResultType.ParameterValue, "configNetwork"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "configAuth".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'configAuth'", "configAuth", global::System.Management.Automation.CompletionResultType.ParameterValue, "configAuth"); - } - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DryrunPreviewOperationType.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DryrunPreviewOperationType.TypeConverter.cs deleted file mode 100644 index 03d3d90a49f7..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DryrunPreviewOperationType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// The operation type - public partial class DryrunPreviewOperationTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => DryrunPreviewOperationType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DryrunPreviewOperationType.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DryrunPreviewOperationType.cs deleted file mode 100644 index 04aa732ef609..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/DryrunPreviewOperationType.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// The operation type - public partial struct DryrunPreviewOperationType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPreviewOperationType ConfigAuth = @"configAuth"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPreviewOperationType ConfigConnection = @"configConnection"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPreviewOperationType ConfigNetwork = @"configNetwork"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to DryrunPreviewOperationType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new DryrunPreviewOperationType(global::System.Convert.ToString(value)); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private DryrunPreviewOperationType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Compares values of enum type DryrunPreviewOperationType - /// 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.ServiceLinker.Support.DryrunPreviewOperationType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type DryrunPreviewOperationType (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 DryrunPreviewOperationType && Equals((DryrunPreviewOperationType)obj); - } - - /// Returns hashCode for enum DryrunPreviewOperationType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for DryrunPreviewOperationType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to DryrunPreviewOperationType - /// the value to convert to an instance of . - - public static implicit operator DryrunPreviewOperationType(string value) - { - return new DryrunPreviewOperationType(value); - } - - /// Implicit operator to convert DryrunPreviewOperationType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPreviewOperationType e) - { - return e._value; - } - - /// Overriding != operator for enum DryrunPreviewOperationType - /// 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.ServiceLinker.Support.DryrunPreviewOperationType e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPreviewOperationType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum DryrunPreviewOperationType - /// 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.ServiceLinker.Support.DryrunPreviewOperationType e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DryrunPreviewOperationType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/Origin.Completer.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/Origin.Completer.cs deleted file mode 100644 index a68d145a7946..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/Origin.Completer.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// - /// The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is - /// "user,system" - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.OriginTypeConverter))] - public partial struct Origin : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "user".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'user'", "user", global::System.Management.Automation.CompletionResultType.ParameterValue, "user"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "system".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'system'", "system", global::System.Management.Automation.CompletionResultType.ParameterValue, "system"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "user,system".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'user,system'", "user,system", global::System.Management.Automation.CompletionResultType.ParameterValue, "user,system"); - } - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/Origin.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/Origin.TypeConverter.cs deleted file mode 100644 index 55bd9ec1c2e3..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/Origin.TypeConverter.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// - /// The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is - /// "user,system" - /// - public partial class OriginTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => Origin.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/Origin.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/Origin.cs deleted file mode 100644 index eea2e189850a..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/Origin.cs +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// - /// The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is - /// "user,system" - /// - public partial struct Origin : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.Origin System = @"system"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.Origin User = @"user"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.Origin UserSystem = @"user,system"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to Origin - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new Origin(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type Origin - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.Origin e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type Origin (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is Origin && Equals((Origin)obj); - } - - /// Returns hashCode for enum Origin - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private Origin(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for Origin - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to Origin - /// the value to convert to an instance of . - - public static implicit operator Origin(string value) - { - return new Origin(value); - } - - /// Implicit operator to convert Origin to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.Origin e) - { - return e._value; - } - - /// Overriding != operator for enum Origin - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.Origin e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.Origin e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum Origin - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.Origin e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.Origin e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/SecretType.Completer.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/SecretType.Completer.cs deleted file mode 100644 index 8f684b568b3d..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/SecretType.Completer.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// The secret type. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretTypeTypeConverter))] - public partial struct SecretType : - 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) || "rawValue".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'rawValue'", "rawValue", global::System.Management.Automation.CompletionResultType.ParameterValue, "rawValue"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "keyVaultSecretUri".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'keyVaultSecretUri'", "keyVaultSecretUri", global::System.Management.Automation.CompletionResultType.ParameterValue, "keyVaultSecretUri"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "keyVaultSecretReference".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'keyVaultSecretReference'", "keyVaultSecretReference", global::System.Management.Automation.CompletionResultType.ParameterValue, "keyVaultSecretReference"); - } - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/SecretType.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/SecretType.TypeConverter.cs deleted file mode 100644 index e5fd49327af5..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/SecretType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// The secret type. - public partial class SecretTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => SecretType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/SecretType.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/SecretType.cs deleted file mode 100644 index 71876f7c197d..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/SecretType.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// The secret type. - public partial struct SecretType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType KeyVaultSecretReference = @"keyVaultSecretReference"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType KeyVaultSecretUri = @"keyVaultSecretUri"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType RawValue = @"rawValue"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to SecretType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new SecretType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type SecretType - /// 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.ServiceLinker.Support.SecretType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type SecretType (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 SecretType && Equals((SecretType)obj); - } - - /// Returns hashCode for enum SecretType - /// 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 SecretType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for SecretType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to SecretType - /// the value to convert to an instance of . - - public static implicit operator SecretType(string value) - { - return new SecretType(value); - } - - /// Implicit operator to convert SecretType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType e) - { - return e._value; - } - - /// Overriding != operator for enum SecretType - /// 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.ServiceLinker.Support.SecretType e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum SecretType - /// 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.ServiceLinker.Support.SecretType e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.SecretType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/TargetServiceType.Completer.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/TargetServiceType.Completer.cs deleted file mode 100644 index ce836e403f0a..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/TargetServiceType.Completer.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// The target service type. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceTypeTypeConverter))] - public partial struct TargetServiceType : - 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) || "AzureResource".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AzureResource'", "AzureResource", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureResource"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ConfluentBootstrapServer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ConfluentBootstrapServer'", "ConfluentBootstrapServer", global::System.Management.Automation.CompletionResultType.ParameterValue, "ConfluentBootstrapServer"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ConfluentSchemaRegistry".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ConfluentSchemaRegistry'", "ConfluentSchemaRegistry", global::System.Management.Automation.CompletionResultType.ParameterValue, "ConfluentSchemaRegistry"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SelfHostedServer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SelfHostedServer'", "SelfHostedServer", global::System.Management.Automation.CompletionResultType.ParameterValue, "SelfHostedServer"); - } - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/TargetServiceType.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/TargetServiceType.TypeConverter.cs deleted file mode 100644 index 0c926650b84d..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/TargetServiceType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// The target service type. - public partial class TargetServiceTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => TargetServiceType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/TargetServiceType.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/TargetServiceType.cs deleted file mode 100644 index b38620d3ab95..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/TargetServiceType.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// The target service type. - public partial struct TargetServiceType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType AzureResource = @"AzureResource"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType ConfluentBootstrapServer = @"ConfluentBootstrapServer"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType ConfluentSchemaRegistry = @"ConfluentSchemaRegistry"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType SelfHostedServer = @"SelfHostedServer"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to TargetServiceType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new TargetServiceType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type TargetServiceType - /// 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.ServiceLinker.Support.TargetServiceType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type TargetServiceType (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 TargetServiceType && Equals((TargetServiceType)obj); - } - - /// Returns hashCode for enum TargetServiceType - /// 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 TargetServiceType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for TargetServiceType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to TargetServiceType - /// the value to convert to an instance of . - - public static implicit operator TargetServiceType(string value) - { - return new TargetServiceType(value); - } - - /// Implicit operator to convert TargetServiceType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType e) - { - return e._value; - } - - /// Overriding != operator for enum TargetServiceType - /// 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.ServiceLinker.Support.TargetServiceType e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum TargetServiceType - /// 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.ServiceLinker.Support.TargetServiceType e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.TargetServiceType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/VNetSolutionType.Completer.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/VNetSolutionType.Completer.cs deleted file mode 100644 index c0192a6074d8..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/VNetSolutionType.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// Type of VNet solution. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionTypeTypeConverter))] - public partial struct VNetSolutionType : - 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) || "serviceEndpoint".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'serviceEndpoint'", "serviceEndpoint", global::System.Management.Automation.CompletionResultType.ParameterValue, "serviceEndpoint"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "privateLink".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'privateLink'", "privateLink", global::System.Management.Automation.CompletionResultType.ParameterValue, "privateLink"); - } - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/VNetSolutionType.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/VNetSolutionType.TypeConverter.cs deleted file mode 100644 index 99c3739aae9a..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/VNetSolutionType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// Type of VNet solution. - public partial class VNetSolutionTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => VNetSolutionType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/VNetSolutionType.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/VNetSolutionType.cs deleted file mode 100644 index fc5712e8fbdf..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/VNetSolutionType.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// Type of VNet solution. - public partial struct VNetSolutionType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType PrivateLink = @"privateLink"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType ServiceEndpoint = @"serviceEndpoint"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to VNetSolutionType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new VNetSolutionType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type VNetSolutionType - /// 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.ServiceLinker.Support.VNetSolutionType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type VNetSolutionType (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 VNetSolutionType && Equals((VNetSolutionType)obj); - } - - /// Returns hashCode for enum VNetSolutionType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for VNetSolutionType - /// 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 VNetSolutionType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to VNetSolutionType - /// the value to convert to an instance of . - - public static implicit operator VNetSolutionType(string value) - { - return new VNetSolutionType(value); - } - - /// Implicit operator to convert VNetSolutionType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType e) - { - return e._value; - } - - /// Overriding != operator for enum VNetSolutionType - /// 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.ServiceLinker.Support.VNetSolutionType e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum VNetSolutionType - /// 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.ServiceLinker.Support.VNetSolutionType e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ValidationResultStatus.Completer.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ValidationResultStatus.Completer.cs deleted file mode 100644 index 0abfba840667..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ValidationResultStatus.Completer.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// The result of validation - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ValidationResultStatusTypeConverter))] - public partial struct ValidationResultStatus : - 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) || "success".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'success'", "success", global::System.Management.Automation.CompletionResultType.ParameterValue, "success"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "failure".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'failure'", "failure", global::System.Management.Automation.CompletionResultType.ParameterValue, "failure"); - } - 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"); - } - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ValidationResultStatus.TypeConverter.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ValidationResultStatus.TypeConverter.cs deleted file mode 100644 index daefe9748925..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ValidationResultStatus.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// The result of validation - public partial class ValidationResultStatusTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => ValidationResultStatus.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ValidationResultStatus.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ValidationResultStatus.cs deleted file mode 100644 index a63d19ada867..000000000000 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/api/Support/ValidationResultStatus.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support -{ - - /// The result of validation - public partial struct ValidationResultStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ValidationResultStatus Failure = @"failure"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ValidationResultStatus Success = @"success"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ValidationResultStatus Warning = @"warning"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ValidationResultStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ValidationResultStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ValidationResultStatus - /// 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.ServiceLinker.Support.ValidationResultStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ValidationResultStatus (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 ValidationResultStatus && Equals((ValidationResultStatus)obj); - } - - /// Returns hashCode for enum ValidationResultStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ValidationResultStatus - /// 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 ValidationResultStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to ValidationResultStatus - /// the value to convert to an instance of . - - public static implicit operator ValidationResultStatus(string value) - { - return new ValidationResultStatus(value); - } - - /// Implicit operator to convert ValidationResultStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ValidationResultStatus e) - { - return e._value; - } - - /// Overriding != operator for enum ValidationResultStatus - /// 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.ServiceLinker.Support.ValidationResultStatus e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ValidationResultStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ValidationResultStatus - /// 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.ServiceLinker.Support.ValidationResultStatus e1, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ValidationResultStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinkerConfigurationName_List.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinkerConfigurationName_List.cs index b2aa2920685e..6cbf626753b0 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinkerConfigurationName_List.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinkerConfigurationName_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; using System; /// @@ -15,12 +17,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets /// [OpenAPI] List=>GET:"/providers/Microsoft.ServiceLinker/configurationNames" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzServiceLinkerConfigurationName_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameItem))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameItem))] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Description(@"Lists the configuration names generated by Service Connector for all target, client types, auth types.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/providers/Microsoft.ServiceLinker/configurationNames", ApiVersion = "2022-11-01-preview")] public partial class GetAzServiceLinkerConfigurationName_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,17 +39,32 @@ public partial class GetAzServiceLinkerConfigurationName_List : global::System.M /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; @@ -60,6 +78,9 @@ public partial class GetAzServiceLinkerConfigurationName_List : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Backing field for property. private string _filter; @@ -100,7 +121,7 @@ public partial class GetAzServiceLinkerConfigurationName_List : global::System.M /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -137,24 +158,24 @@ public partial class GetAzServiceLinkerConfigurationName_List : global::System.M /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -177,6 +198,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -198,7 +224,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzServiceLinkerConfigurationName_List() { @@ -249,8 +275,33 @@ public GetAzServiceLinkerConfigurationName_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -303,7 +354,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -321,7 +372,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -359,12 +410,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -381,15 +432,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, SkipToken=this.InvocationInformation.BoundParameters.ContainsKey("SkipToken") ? SkipToken : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -399,12 +450,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationNameResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -416,15 +467,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationNameResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinkerConfiguration_List.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinkerConfiguration_List.cs index e9998b7c2184..5f8a36bae3de 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinkerConfiguration_List.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinkerConfiguration_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; using System; /// list source configurations for a Linker. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzServiceLinkerConfiguration_List", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult))] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Description(@"list source configurations for a Linker.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/listConfigurations", ApiVersion = "2022-11-01-preview")] public partial class GetAzServiceLinkerConfiguration_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzServiceLinkerConfiguration_List : global::System.Manag /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzServiceLinkerConfiguration_List : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +114,7 @@ public partial class GetAzServiceLinkerConfiguration_List : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -132,24 +153,24 @@ public partial class GetAzServiceLinkerConfiguration_List : global::System.Manag /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -172,6 +193,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -193,7 +219,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzServiceLinkerConfiguration_List() { @@ -244,8 +270,33 @@ public GetAzServiceLinkerConfiguration_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -301,7 +352,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -319,7 +370,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri,LinkerName=LinkerName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri,LinkerName=LinkerName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -357,12 +408,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -379,15 +430,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri, LinkerName=LinkerName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri, LinkerName=LinkerName }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -397,12 +448,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -414,9 +465,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult + var result = (await response); // response should be returning an array of some kind. +Pageable // nested-array / configurations / - WriteObject((await response).Configuration, true); + if (null != result.Configuration) + { + if (0 == _responseSize && 1 == result.Configuration.Count) + { + _firstResponse = result.Configuration[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Configuration ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinkerDryrun_Get.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinkerDryrun_Get.cs index 7ccd1fa0caae..b87acf5118ac 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinkerDryrun_Get.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinkerDryrun_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; using System; /// get a dryrun job @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzServiceLinkerDryrun_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Description(@"get a dryrun job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}", ApiVersion = "2022-11-01-preview")] public partial class GetAzServiceLinkerDryrun_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzServiceLinkerDryrun_Get : global::System.Management.Au /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; @@ -67,6 +85,9 @@ public partial class GetAzServiceLinkerDryrun_Get : global::System.Management.Au [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Path)] public string DryrunName { get => this._dryrunName; set => this._dryrunName = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +114,7 @@ public partial class GetAzServiceLinkerDryrun_Get : global::System.Management.Au /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -132,24 +153,24 @@ public partial class GetAzServiceLinkerDryrun_Get : global::System.Management.Au /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -172,6 +193,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -193,7 +219,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzServiceLinkerDryrun_Get() { @@ -244,8 +270,33 @@ public GetAzServiceLinkerDryrun_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -298,7 +349,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -316,7 +367,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri,DryrunName=DryrunName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri,DryrunName=DryrunName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -354,12 +405,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -376,15 +427,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri, DryrunName=DryrunName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri, DryrunName=DryrunName }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -394,12 +445,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -411,8 +462,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinkerDryrun_GetViaIdentity.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinkerDryrun_GetViaIdentity.cs index c049e4a0d59a..40ac294f9b98 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinkerDryrun_GetViaIdentity.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinkerDryrun_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; using System; /// get a dryrun job @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzServiceLinkerDryrun_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Description(@"get a dryrun job")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}", ApiVersion = "2022-11-01-preview")] public partial class GetAzServiceLinkerDryrun_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzServiceLinkerDryrun_GetViaIdentity : global::System.Ma /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzServiceLinkerDryrun_GetViaIdentity : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -87,7 +108,7 @@ public partial class GetAzServiceLinkerDryrun_GetViaIdentity : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -110,24 +131,24 @@ public partial class GetAzServiceLinkerDryrun_GetViaIdentity : global::System.Ma /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -150,6 +171,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -171,7 +197,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzServiceLinkerDryrun_GetViaIdentity() { @@ -222,8 +248,33 @@ public GetAzServiceLinkerDryrun_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -276,7 +327,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -310,7 +361,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -348,12 +399,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -370,7 +421,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -388,12 +439,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -405,8 +456,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinkerDryrun_List.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinkerDryrun_List.cs index 2144a0c88826..b5447d9e984b 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinkerDryrun_List.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinkerDryrun_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; using System; /// list dryrun jobs @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzServiceLinkerDryrun_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Description(@"list dryrun jobs")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns", ApiVersion = "2022-11-01-preview")] public partial class GetAzServiceLinkerDryrun_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,17 +38,32 @@ public partial class GetAzServiceLinkerDryrun_List : global::System.Management.A /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; @@ -59,6 +77,9 @@ public partial class GetAzServiceLinkerDryrun_List : global::System.Management.A [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -85,7 +106,7 @@ public partial class GetAzServiceLinkerDryrun_List : global::System.Management.A /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -124,24 +145,24 @@ public partial class GetAzServiceLinkerDryrun_List : global::System.Management.A /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunList /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -164,6 +185,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -185,7 +211,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzServiceLinkerDryrun_List() { @@ -236,8 +262,33 @@ public GetAzServiceLinkerDryrun_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -290,7 +341,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -308,7 +359,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -346,12 +397,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -368,15 +419,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -386,12 +437,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunList /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -403,15 +454,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunList + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinkerOperation_List.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinkerOperation_List.cs index 91e1c07554a6..7d6aa9309698 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinkerOperation_List.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinkerOperation_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; using System; /// Lists the available ServiceLinker REST API operations. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzServiceLinkerOperation_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperation))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperation))] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Description(@"Lists the available ServiceLinker REST API operations.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/providers/Microsoft.ServiceLinker/operations", ApiVersion = "2022-11-01-preview")] public partial class GetAzServiceLinkerOperation_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,17 +38,32 @@ public partial class GetAzServiceLinkerOperation_List : global::System.Managemen /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; @@ -59,6 +77,9 @@ public partial class GetAzServiceLinkerOperation_List : global::System.Managemen [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -85,7 +106,7 @@ public partial class GetAzServiceLinkerOperation_List : global::System.Managemen /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -108,24 +129,24 @@ public partial class GetAzServiceLinkerOperation_List : global::System.Managemen /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationListResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -148,6 +169,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -169,7 +195,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzServiceLinkerOperation_List() { @@ -220,8 +246,33 @@ public GetAzServiceLinkerOperation_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -274,7 +325,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -292,7 +343,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -330,12 +381,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -352,7 +403,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -370,12 +421,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperationListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationListResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -387,15 +438,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperationListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinker_Get.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinker_Get.cs index 5df8daee00ec..eeff09dabea2 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinker_Get.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinker_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; using System; /// Returns Linker resource for a given name. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzServiceLinker_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Description(@"Returns Linker resource for a given name.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", ApiVersion = "2022-11-01-preview")] public partial class GetAzServiceLinker_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzServiceLinker_Get : global::System.Management.Automati /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzServiceLinker_Get : global::System.Management.Automati [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -94,7 +115,7 @@ public partial class GetAzServiceLinker_Get : global::System.Management.Automati /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -133,24 +154,24 @@ public partial class GetAzServiceLinker_Get : global::System.Management.Automati /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -173,6 +194,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -194,7 +220,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzServiceLinker_Get() { @@ -245,8 +271,33 @@ public GetAzServiceLinker_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -299,7 +350,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -317,7 +368,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -355,12 +406,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -377,15 +428,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -395,12 +446,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -412,8 +463,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinker_GetViaIdentity.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinker_GetViaIdentity.cs index d5dfc0b459fc..6fcf5020d908 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinker_GetViaIdentity.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinker_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; using System; /// Returns Linker resource for a given name. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzServiceLinker_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Description(@"Returns Linker resource for a given name.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", ApiVersion = "2022-11-01-preview")] public partial class GetAzServiceLinker_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzServiceLinker_GetViaIdentity : global::System.Manageme /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzServiceLinker_GetViaIdentity : global::System.Manageme [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -87,7 +108,7 @@ public partial class GetAzServiceLinker_GetViaIdentity : global::System.Manageme /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -110,24 +131,24 @@ public partial class GetAzServiceLinker_GetViaIdentity : global::System.Manageme /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -150,6 +171,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -171,7 +197,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzServiceLinker_GetViaIdentity() { @@ -222,8 +248,33 @@ public GetAzServiceLinker_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -276,7 +327,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -310,7 +361,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -348,12 +399,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -370,7 +421,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -388,12 +439,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -405,8 +456,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinker_List.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinker_List.cs index c04a8b5c9a4e..079756b57176 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinker_List.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/GetAzServiceLinker_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; using System; /// @@ -17,12 +19,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzServiceLinker_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Description(@"Returns list of Linkers which connects to the resource. which supports to config both application and target service during the resource provision.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers", ApiVersion = "2022-11-01-preview")] public partial class GetAzServiceLinker_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -38,17 +41,32 @@ public partial class GetAzServiceLinker_List : global::System.Management.Automat /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; @@ -62,6 +80,9 @@ public partial class GetAzServiceLinker_List : global::System.Management.Automat [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -88,7 +109,7 @@ public partial class GetAzServiceLinker_List : global::System.Management.Automat /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -127,24 +148,24 @@ public partial class GetAzServiceLinker_List : global::System.Management.Automat /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IResourceList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceList /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -167,6 +188,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -188,7 +214,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzServiceLinker_List() { @@ -239,8 +265,33 @@ public GetAzServiceLinker_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -293,7 +344,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -311,7 +362,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -349,12 +400,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -371,15 +422,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -389,12 +440,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IResourceList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceList /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -406,15 +457,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IResourceList + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerConfiguration_Generate.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerConfiguration_Generate.cs index 2eeb864d42ec..19ee9f91c488 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerConfiguration_Generate.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerConfiguration_Generate.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; using System; /// Generate configurations for a Linker. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzServiceLinkerConfiguration_Generate", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult))] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Description(@"Generate configurations for a Linker.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/generateConfigurations", ApiVersion = "2022-11-01-preview")] public partial class NewAzServiceLinkerConfiguration_Generate : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class NewAzServiceLinkerConfiguration_Generate : global::System.M /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class NewAzServiceLinkerConfiguration_Generate : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -91,7 +112,7 @@ public partial class NewAzServiceLinkerConfiguration_Generate : global::System.M global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener.Token => _cancellationTokenSource.Token; /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo _parameter; + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo _parameter; /// /// The configuration information, used to generate configurations or save to applications @@ -102,13 +123,14 @@ public partial class NewAzServiceLinkerConfiguration_Generate : global::System.M ReadOnly = false, Description = @"The configuration information, used to generate configurations or save to applications", SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo) })] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo Parameter { get => this._parameter; set => this._parameter = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo Parameter { get => this._parameter; set => this._parameter = value; } /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -147,24 +169,24 @@ public partial class NewAzServiceLinkerConfiguration_Generate : global::System.M /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -187,6 +209,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -251,8 +278,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -262,7 +314,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzServiceLinkerConfiguration_Generate() { @@ -316,7 +368,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -334,7 +386,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri,LinkerName=LinkerName,body=Parameter}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri,LinkerName=LinkerName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -372,12 +424,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -394,15 +446,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri, LinkerName=LinkerName, body=Parameter }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri, LinkerName=LinkerName, body=Parameter }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -412,12 +464,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -429,9 +481,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult + var result = (await response); // response should be returning an array of some kind. +Pageable // nested-array / configurations / - WriteObject((await response).Configuration, true); + if (null != result.Configuration) + { + if (0 == _responseSize && 1 == result.Configuration.Count) + { + _firstResponse = result.Configuration[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Configuration ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerConfiguration_GenerateExpanded.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerConfiguration_GenerateExpanded.cs index 249c94177b1d..dd258f8dc2fa 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerConfiguration_GenerateExpanded.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerConfiguration_GenerateExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; using System; /// Generate configurations for a Linker. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzServiceLinkerConfiguration_GenerateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult))] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Description(@"Generate configurations for a Linker.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/generateConfigurations", ApiVersion = "2022-11-01-preview")] public partial class NewAzServiceLinkerConfiguration_GenerateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,10 +38,22 @@ public partial class NewAzServiceLinkerConfiguration_GenerateExpanded : global:: /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// /// The configuration information, used to generate configurations or save to applications /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfo(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfo(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// /// Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied @@ -51,9 +66,9 @@ public partial class NewAzServiceLinkerConfiguration_GenerateExpanded : global:: ReadOnly = false, Description = @"Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied to the source application. Default is enable. If optOut, no configuration change will be made on source.", SerializedName = @"action", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType Action { get => _parametersBody.Action ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType)""); set => _parametersBody.Action = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + public string Action { get => _parametersBody.Action ?? null; set => _parametersBody.Action = value; } /// /// A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this @@ -67,14 +82,17 @@ public partial class NewAzServiceLinkerConfiguration_GenerateExpanded : global:: ReadOnly = false, Description = @"A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this property is to full fill more customized configurations", SerializedName = @"additionalConfigurations", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations) })] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations AdditionalConfiguration { get => _parametersBody.AdditionalConfiguration ?? null /* object */; set => _parametersBody.AdditionalConfiguration = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations) })] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations AdditionalConfiguration { get => _parametersBody.AdditionalConfiguration ?? null /* object */; set => _parametersBody.AdditionalConfiguration = 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.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; @@ -90,8 +108,8 @@ public partial class NewAzServiceLinkerConfiguration_GenerateExpanded : global:: ReadOnly = false, Description = @"Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be used for generate configurations", SerializedName = @"customizedKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys) })] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys CustomizedKey { get => _parametersBody.CustomizedKey ?? null /* object */; set => _parametersBody.CustomizedKey = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys) })] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys CustomizedKey { get => _parametersBody.CustomizedKey ?? null /* object */; set => _parametersBody.CustomizedKey = value; } /// /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet @@ -113,10 +131,13 @@ public partial class NewAzServiceLinkerConfiguration_GenerateExpanded : global:: ReadOnly = false, Description = @"Indicates whether to clean up previous operation when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] + PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.DoNotExport] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior DeleteOrUpdateBehavior { get => _parametersBody.DeleteOrUpdateBehavior ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior)""); set => _parametersBody.DeleteOrUpdateBehavior = value; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + public string DeleteOrUpdateBehavior { get => _parametersBody.DeleteOrUpdateBehavior ?? null; set => _parametersBody.DeleteOrUpdateBehavior = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] @@ -158,7 +179,7 @@ public partial class NewAzServiceLinkerConfiguration_GenerateExpanded : global:: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -197,24 +218,24 @@ public partial class NewAzServiceLinkerConfiguration_GenerateExpanded : global:: /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -237,6 +258,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -301,8 +327,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -312,7 +363,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzServiceLinkerConfiguration_GenerateExpanded() { @@ -366,7 +417,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -376,6 +427,10 @@ protected override void ProcessRecord() Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); } // get the client instance + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("DeleteOrUpdateBehavior")) + { + DeleteOrUpdateBehavior = (string)this.MyInvocation.BoundParameters["DeleteOrUpdateBehavior"]; + } try { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } @@ -384,7 +439,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri,LinkerName=LinkerName,body=_parametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri,LinkerName=LinkerName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -422,12 +477,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -444,15 +499,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri, LinkerName=LinkerName, body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri, LinkerName=LinkerName, body=_parametersBody }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -462,12 +517,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -479,9 +534,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult + var result = (await response); // response should be returning an array of some kind. +Pageable // nested-array / configurations / - WriteObject((await response).Configuration, true); + if (null != result.Configuration) + { + if (0 == _responseSize && 1 == result.Configuration.Count) + { + _firstResponse = result.Configuration[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Configuration ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerConfiguration_GenerateViaIdentity.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerConfiguration_GenerateViaIdentity.cs index ce7104933e06..2f3781b4b558 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerConfiguration_GenerateViaIdentity.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerConfiguration_GenerateViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; using System; /// Generate configurations for a Linker. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzServiceLinkerConfiguration_GenerateViaIdentity", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult))] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Description(@"Generate configurations for a Linker.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/generateConfigurations", ApiVersion = "2022-11-01-preview")] public partial class NewAzServiceLinkerConfiguration_GenerateViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class NewAzServiceLinkerConfiguration_GenerateViaIdentity : globa /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class NewAzServiceLinkerConfiguration_GenerateViaIdentity : globa [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -85,7 +106,7 @@ public partial class NewAzServiceLinkerConfiguration_GenerateViaIdentity : globa global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener.Token => _cancellationTokenSource.Token; /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo _parameter; + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo _parameter; /// /// The configuration information, used to generate configurations or save to applications @@ -96,13 +117,14 @@ public partial class NewAzServiceLinkerConfiguration_GenerateViaIdentity : globa ReadOnly = false, Description = @"The configuration information, used to generate configurations or save to applications", SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo) })] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo Parameter { get => this._parameter; set => this._parameter = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo Parameter { get => this._parameter; set => this._parameter = value; } /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -125,24 +147,24 @@ public partial class NewAzServiceLinkerConfiguration_GenerateViaIdentity : globa /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -165,6 +187,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -229,8 +256,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -240,7 +292,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzServiceLinkerConfiguration_GenerateViaIdentity() { @@ -294,7 +346,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -328,7 +380,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + 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 } }); @@ -366,12 +418,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -388,15 +440,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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 }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -406,12 +458,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -423,9 +475,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult + var result = (await response); // response should be returning an array of some kind. +Pageable // nested-array / configurations / - WriteObject((await response).Configuration, true); + if (null != result.Configuration) + { + if (0 == _responseSize && 1 == result.Configuration.Count) + { + _firstResponse = result.Configuration[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Configuration ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerConfiguration_GenerateViaIdentityExpanded.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerConfiguration_GenerateViaIdentityExpanded.cs index 90e3b3610183..8c12d9327ce6 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerConfiguration_GenerateViaIdentityExpanded.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerConfiguration_GenerateViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; using System; /// Generate configurations for a Linker. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzServiceLinkerConfiguration_GenerateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult))] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Description(@"Generate configurations for a Linker.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/generateConfigurations", ApiVersion = "2022-11-01-preview")] public partial class NewAzServiceLinkerConfiguration_GenerateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,10 +38,22 @@ public partial class NewAzServiceLinkerConfiguration_GenerateViaIdentityExpanded /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// /// The configuration information, used to generate configurations or save to applications /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ConfigurationInfo(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ConfigurationInfo(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// /// Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied @@ -51,9 +66,9 @@ public partial class NewAzServiceLinkerConfiguration_GenerateViaIdentityExpanded ReadOnly = false, Description = @"Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied to the source application. Default is enable. If optOut, no configuration change will be made on source.", SerializedName = @"action", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType Action { get => _parametersBody.Action ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType)""); set => _parametersBody.Action = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + public string Action { get => _parametersBody.Action ?? null; set => _parametersBody.Action = value; } /// /// A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this @@ -67,14 +82,17 @@ public partial class NewAzServiceLinkerConfiguration_GenerateViaIdentityExpanded ReadOnly = false, Description = @"A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this property is to full fill more customized configurations", SerializedName = @"additionalConfigurations", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations) })] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations AdditionalConfiguration { get => _parametersBody.AdditionalConfiguration ?? null /* object */; set => _parametersBody.AdditionalConfiguration = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations) })] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations AdditionalConfiguration { get => _parametersBody.AdditionalConfiguration ?? null /* object */; set => _parametersBody.AdditionalConfiguration = 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.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; @@ -90,8 +108,8 @@ public partial class NewAzServiceLinkerConfiguration_GenerateViaIdentityExpanded ReadOnly = false, Description = @"Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be used for generate configurations", SerializedName = @"customizedKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys) })] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys CustomizedKey { get => _parametersBody.CustomizedKey ?? null /* object */; set => _parametersBody.CustomizedKey = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys) })] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys CustomizedKey { get => _parametersBody.CustomizedKey ?? null /* object */; set => _parametersBody.CustomizedKey = value; } /// /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet @@ -113,10 +131,13 @@ public partial class NewAzServiceLinkerConfiguration_GenerateViaIdentityExpanded ReadOnly = false, Description = @"Indicates whether to clean up previous operation when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] + PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.DoNotExport] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior DeleteOrUpdateBehavior { get => _parametersBody.DeleteOrUpdateBehavior ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior)""); set => _parametersBody.DeleteOrUpdateBehavior = value; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + public string DeleteOrUpdateBehavior { get => _parametersBody.DeleteOrUpdateBehavior ?? null; set => _parametersBody.DeleteOrUpdateBehavior = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] @@ -152,7 +173,7 @@ public partial class NewAzServiceLinkerConfiguration_GenerateViaIdentityExpanded /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -175,24 +196,24 @@ public partial class NewAzServiceLinkerConfiguration_GenerateViaIdentityExpanded /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -215,6 +236,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -279,8 +305,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -290,7 +341,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzServiceLinkerConfiguration_GenerateViaIdentityExpanded() { @@ -344,7 +395,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -354,6 +405,10 @@ protected override void ProcessRecord() Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); } // get the client instance + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("DeleteOrUpdateBehavior")) + { + DeleteOrUpdateBehavior = (string)this.MyInvocation.BoundParameters["DeleteOrUpdateBehavior"]; + } try { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } @@ -378,7 +433,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -416,12 +471,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -438,15 +493,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -456,12 +511,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -473,9 +528,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult + var result = (await response); // response should be returning an array of some kind. +Pageable // nested-array / configurations / - WriteObject((await response).Configuration, true); + if (null != result.Configuration) + { + if (0 == _responseSize && 1 == result.Configuration.Count) + { + _firstResponse = result.Configuration[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Configuration ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerConfiguration_GenerateViaJsonFilePath.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerConfiguration_GenerateViaJsonFilePath.cs new file mode 100644 index 000000000000..a7e12754790b --- /dev/null +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerConfiguration_GenerateViaJsonFilePath.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.ServiceLinker.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; + using System; + + /// Generate configurations for a Linker. + /// + /// [OpenAPI] GenerateConfigurations=>POST:"/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/generateConfigurations" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzServiceLinkerConfiguration_GenerateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Description(@"Generate configurations for a Linker.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/generateConfigurations", ApiVersion = "2022-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.NotSuggestDefaultParameterSet] + public partial class NewAzServiceLinkerConfiguration_GenerateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Generate operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Generate operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Generate operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// Backing field for property. + private string _linkerName; + + /// The name Linker resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name Linker resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name Linker resource.", + SerializedName = @"linkerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Path)] + public string LinkerName { get => this._linkerName; set => this._linkerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceUri; + + /// + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The fully qualified Azure Resource manager identifier of the resource to be connected.")] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The fully qualified Azure Resource manager identifier of the resource to be connected.", + SerializedName = @"resourceUri", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Path)] + public string ResourceUri { get => this._resourceUri; set => this._resourceUri = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"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.ServiceLinker.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzServiceLinkerConfiguration_GenerateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'LinkersGenerateConfigurations' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.LinkersGenerateConfigurationsViaJsonString(ResourceUri, LinkerName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri,LinkerName=LinkerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.ServiceLinker.Models.IConfigurationResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult + var result = (await response); + // response should be returning an array of some kind. +Pageable + // nested-array / configurations / + if (null != result.Configuration) + { + if (0 == _responseSize && 1 == result.Configuration.Count) + { + _firstResponse = result.Configuration[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Configuration ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerConfiguration_GenerateViaJsonString.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerConfiguration_GenerateViaJsonString.cs new file mode 100644 index 000000000000..331bc5925462 --- /dev/null +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerConfiguration_GenerateViaJsonString.cs @@ -0,0 +1,512 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; + using System; + + /// Generate configurations for a Linker. + /// + /// [OpenAPI] GenerateConfigurations=>POST:"/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/generateConfigurations" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzServiceLinkerConfiguration_GenerateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Description(@"Generate configurations for a Linker.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/generateConfigurations", ApiVersion = "2022-11-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.NotSuggestDefaultParameterSet] + public partial class NewAzServiceLinkerConfiguration_GenerateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Generate operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Generate operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Generate operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// Backing field for property. + private string _linkerName; + + /// The name Linker resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name Linker resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name Linker resource.", + SerializedName = @"linkerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Path)] + public string LinkerName { get => this._linkerName; set => this._linkerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceUri; + + /// + /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The fully qualified Azure Resource manager identifier of the resource to be connected.")] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The fully qualified Azure Resource manager identifier of the resource to be connected.", + SerializedName = @"resourceUri", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Path)] + public string ResourceUri { get => this._resourceUri; set => this._resourceUri = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"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.ServiceLinker.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzServiceLinkerConfiguration_GenerateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'LinkersGenerateConfigurations' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.LinkersGenerateConfigurationsViaJsonString(ResourceUri, LinkerName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri,LinkerName=LinkerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.ServiceLinker.Models.IConfigurationResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult + var result = (await response); + // response should be returning an array of some kind. +Pageable + // nested-array / configurations / + if (null != result.Configuration) + { + if (0 == _responseSize && 1 == result.Configuration.Count) + { + _firstResponse = result.Configuration[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Configuration ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerDryrun_CreateExpanded.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerDryrun_CreateExpanded.cs index d2ceb38e0050..e2124b443122 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerDryrun_CreateExpanded.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerDryrun_CreateExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; using System; /// create a dryrun job to do necessary check before actual creation @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzServiceLinkerDryrun_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Description(@"create a dryrun job to do necessary check before actual creation")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}", ApiVersion = "2022-11-01-preview")] public partial class NewAzServiceLinkerDryrun_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +38,20 @@ public partial class NewAzServiceLinkerDryrun_CreateExpanded : global::System.Ma /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// a dryrun job resource - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunResource(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunResource(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -48,6 +63,9 @@ public partial class NewAzServiceLinkerDryrun_CreateExpanded : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; @@ -75,6 +93,9 @@ public partial class NewAzServiceLinkerDryrun_CreateExpanded : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Path)] public string DryrunName { get => this._dryrunName; set => this._dryrunName = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -109,7 +130,7 @@ public partial class NewAzServiceLinkerDryrun_CreateExpanded : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -148,24 +169,24 @@ public partial class NewAzServiceLinkerDryrun_CreateExpanded : global::System.Ma /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -211,6 +232,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets.NewAzServiceLink /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -275,11 +301,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -291,10 +342,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -304,7 +371,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzServiceLinkerDryrun_CreateExpanded() { @@ -370,7 +437,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -383,12 +450,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.LinkersCreateDryrun(ResourceUri, DryrunName, _parametersBody, onOk, onDefault, this, Pipeline); + await this.Client.LinkersCreateDryrun(ResourceUri, DryrunName, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri,DryrunName=DryrunName,body=_parametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri,DryrunName=DryrunName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -426,12 +493,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -448,15 +515,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri, DryrunName=DryrunName, body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri, DryrunName=DryrunName, body=_parametersBody }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -466,12 +533,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -483,8 +550,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerDryrun_CreateViaIdentityExpanded.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerDryrun_CreateViaIdentityExpanded.cs new file mode 100644 index 000000000000..ba9b262f7011 --- /dev/null +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinkerDryrun_CreateViaIdentityExpanded.cs @@ -0,0 +1,568 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; + using System; + + /// create a dryrun job to do necessary check before actual creation + /// + /// [OpenAPI] CreateDryrun=>PUT:"/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzServiceLinkerDryrun_CreateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Description(@"create a dryrun job to do necessary check before actual creation")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}", ApiVersion = "2022-11-01-preview")] + public partial class NewAzServiceLinkerDryrun_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// a dryrun job resource + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunResource(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity 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.ServiceLinker.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzServiceLinkerDryrun_CreateViaIdentityExpanded + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets.NewAzServiceLinkerDryrun_CreateViaIdentityExpanded Clone() + { + var clone = new NewAzServiceLinkerDryrun_CreateViaIdentityExpanded(); + 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"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.ServiceLinker.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzServiceLinkerDryrun_CreateViaIdentityExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'LinkersCreateDryrun' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.LinkersCreateDryrunViaIdentity(InputObject.Id, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceUri) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceUri"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DryrunName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DryrunName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.LinkersCreateDryrun(InputObject.ResourceUri ?? null, InputObject.DryrunName ?? null, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.ServiceLinker.Models.IDryrunResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinker_CreateExpanded.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinker_CreateExpanded.cs index ea8b61f87271..8d6172013b92 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinker_CreateExpanded.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinker_CreateExpanded.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; using System; - /// Create or update Linker resource. + /// create Linker resource. /// /// [OpenAPI] CreateOrUpdate=>PUT:"/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzServiceLinker_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Description(@"Create or update Linker resource.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Description(@"create Linker resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", ApiVersion = "2022-11-01-preview")] public partial class NewAzServiceLinker_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +38,20 @@ public partial class NewAzServiceLinker_CreateExpanded : global::System.Manageme /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// Linker of source and target resource - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerResource(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerResource(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -51,14 +66,17 @@ public partial class NewAzServiceLinker_CreateExpanded : global::System.Manageme ReadOnly = false, Description = @"The authentication type.", SerializedName = @"authInfo", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase) })] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase AuthInfo { get => _parametersBody.AuthInfo ?? null /* object */; set => _parametersBody.AuthInfo = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase) })] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase AuthInfo { get => _parametersBody.AuthInfo ?? null /* object */; set => _parametersBody.AuthInfo = 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.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; @@ -70,13 +88,14 @@ public partial class NewAzServiceLinker_CreateExpanded : global::System.Manageme ReadOnly = false, Description = @"The application client type", SerializedName = @"clientType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType) })] + PossibleTypes = new [] { typeof(string) })] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"""none""")] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType ClientType { get => _parametersBody.ClientType ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType)""); set => _parametersBody.ClientType = value; } + Script = @"""none""", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] + public string ClientType { get => _parametersBody.ClientType ?? null; set => _parametersBody.ClientType = value; } /// /// Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied @@ -89,9 +108,9 @@ public partial class NewAzServiceLinker_CreateExpanded : global::System.Manageme ReadOnly = false, Description = @"Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied to the source application. Default is enable. If optOut, no configuration change will be made on source.", SerializedName = @"action", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType ConfigurationInfoAction { get => _parametersBody.ConfigurationInfoAction ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType)""); set => _parametersBody.ConfigurationInfoAction = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + public string ConfigurationInfoAction { get => _parametersBody.ConfigurationInfoAction ?? null; set => _parametersBody.ConfigurationInfoAction = value; } /// /// A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this @@ -105,8 +124,8 @@ public partial class NewAzServiceLinker_CreateExpanded : global::System.Manageme ReadOnly = false, Description = @"A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this property is to full fill more customized configurations", SerializedName = @"additionalConfigurations", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations) })] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get => _parametersBody.ConfigurationInfoAdditionalConfiguration ?? null /* object */; set => _parametersBody.ConfigurationInfoAdditionalConfiguration = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations) })] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get => _parametersBody.ConfigurationInfoAdditionalConfiguration ?? null /* object */; set => _parametersBody.ConfigurationInfoAdditionalConfiguration = value; } /// /// Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be @@ -120,8 +139,8 @@ public partial class NewAzServiceLinker_CreateExpanded : global::System.Manageme ReadOnly = false, Description = @"Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be used for generate configurations", SerializedName = @"customizedKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys) })] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get => _parametersBody.ConfigurationInfoCustomizedKey ?? null /* object */; set => _parametersBody.ConfigurationInfoCustomizedKey = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys) })] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get => _parametersBody.ConfigurationInfoCustomizedKey ?? null /* object */; set => _parametersBody.ConfigurationInfoCustomizedKey = value; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting @@ -133,10 +152,10 @@ public partial class NewAzServiceLinker_CreateExpanded : global::System.Manageme ReadOnly = false, Description = @"Indicates whether to clean up previous operation when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] + PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.DoNotExport] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior ConfigurationInfoDeleteOrUpdateBehavior { get => _parametersBody.ConfigurationInfoDeleteOrUpdateBehavior ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior)""); set => _parametersBody.ConfigurationInfoDeleteOrUpdateBehavior = value; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + public string ConfigurationInfoDeleteOrUpdateBehavior { get => _parametersBody.ConfigurationInfoDeleteOrUpdateBehavior ?? null; set => _parametersBody.ConfigurationInfoDeleteOrUpdateBehavior = value; } /// /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet @@ -148,6 +167,9 @@ public partial class NewAzServiceLinker_CreateExpanded : global::System.Manageme [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Allow Azure services to access the target service if true. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allow Azure services to access the target service if true.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Body)] @@ -156,9 +178,9 @@ public partial class NewAzServiceLinker_CreateExpanded : global::System.Manageme ReadOnly = false, Description = @"Allow Azure services to access the target service if true.", SerializedName = @"azureServices", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType FirewallRuleAzureService { get => _parametersBody.FirewallRuleAzureService ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType)""); set => _parametersBody.FirewallRuleAzureService = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + public string FirewallRuleAzureService { get => _parametersBody.FirewallRuleAzureService ?? null; set => _parametersBody.FirewallRuleAzureService = value; } /// /// Allow caller client IP to access the target service if true. the property is used when connecting local application to @@ -171,9 +193,9 @@ public partial class NewAzServiceLinker_CreateExpanded : global::System.Manageme ReadOnly = false, Description = @"Allow caller client IP to access the target service if true. the property is used when connecting local application to target service.", SerializedName = @"callerClientIP", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType FirewallRuleCallerClientIP { get => _parametersBody.FirewallRuleCallerClientIP ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType)""); set => _parametersBody.FirewallRuleCallerClientIP = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + public string FirewallRuleCallerClientIP { get => _parametersBody.FirewallRuleCallerClientIP ?? null; set => _parametersBody.FirewallRuleCallerClientIP = value; } /// /// This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client @@ -188,7 +210,7 @@ public partial class NewAzServiceLinker_CreateExpanded : global::System.Manageme Description = @"This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account.", SerializedName = @"ipRanges", PossibleTypes = new [] { typeof(string) })] - public string[] FirewallRuleIPRange { get => _parametersBody.FirewallRuleIPRange ?? null /* arrayOf */; set => _parametersBody.FirewallRuleIPRange = value; } + public string[] FirewallRuleIPRange { get => _parametersBody.FirewallRuleIPRange?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.FirewallRuleIPRange = (value != null ? new System.Collections.Generic.List(value) : null); } /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] @@ -227,7 +249,8 @@ public partial class NewAzServiceLinker_CreateExpanded : global::System.Manageme [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"""connect_""+(-join ((65..90) + (97..122) | Get-Random -Count 5 | % {[char]$_}))")] + Script = @"""connect_""+(-join ((65..90) + (97..122) | Get-Random -Count 5 | % {[char]$_}))", + SetCondition = @"")] [global::System.Management.Automation.Alias("LinkerName")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Path)] public string Name { get => this._name; set => this._name = value; } @@ -243,7 +266,7 @@ public partial class NewAzServiceLinker_CreateExpanded : global::System.Manageme /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -272,9 +295,9 @@ public partial class NewAzServiceLinker_CreateExpanded : global::System.Manageme ReadOnly = false, Description = @"Optional. Indicates public network solution. If enable, enable public network access of target service with best try. Default is enable. If optOut, opt out public network access configuration.", SerializedName = @"action", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType PublicNetworkSolutionAction { get => _parametersBody.PublicNetworkSolutionAction ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType)""); set => _parametersBody.PublicNetworkSolutionAction = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + public string PublicNetworkSolutionAction { get => _parametersBody.PublicNetworkSolutionAction ?? null; set => _parametersBody.PublicNetworkSolutionAction = value; } /// /// Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting @@ -286,10 +309,10 @@ public partial class NewAzServiceLinker_CreateExpanded : global::System.Manageme ReadOnly = false, Description = @"Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] + PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.DoNotExport] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior PublicNetworkSolutionDeleteOrUpdateBehavior { get => _parametersBody.PublicNetworkSolutionDeleteOrUpdateBehavior ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior)""); set => _parametersBody.PublicNetworkSolutionDeleteOrUpdateBehavior = value; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + public string PublicNetworkSolutionDeleteOrUpdateBehavior { get => _parametersBody.PublicNetworkSolutionDeleteOrUpdateBehavior ?? null; set => _parametersBody.PublicNetworkSolutionDeleteOrUpdateBehavior = value; } /// Backing field for property. private string _resourceUri; @@ -348,8 +371,8 @@ public partial class NewAzServiceLinker_CreateExpanded : global::System.Manageme ReadOnly = false, Description = @"The target service properties", SerializedName = @"targetService", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase) })] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase TargetService { get => _parametersBody.TargetService ?? null /* object */; set => _parametersBody.TargetService = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase) })] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase TargetService { get => _parametersBody.TargetService ?? null /* object */; set => _parametersBody.TargetService = value; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting @@ -361,10 +384,10 @@ public partial class NewAzServiceLinker_CreateExpanded : global::System.Manageme ReadOnly = false, Description = @"Indicates whether to clean up previous operation when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] + PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.DoNotExport] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior VNetSolutionDeleteOrUpdateBehavior { get => _parametersBody.VNetSolutionDeleteOrUpdateBehavior ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior)""); set => _parametersBody.VNetSolutionDeleteOrUpdateBehavior = value; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + public string VNetSolutionDeleteOrUpdateBehavior { get => _parametersBody.VNetSolutionDeleteOrUpdateBehavior ?? null; set => _parametersBody.VNetSolutionDeleteOrUpdateBehavior = value; } /// Type of VNet solution. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of VNet solution.")] @@ -374,9 +397,9 @@ public partial class NewAzServiceLinker_CreateExpanded : global::System.Manageme ReadOnly = false, Description = @"Type of VNet solution.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType VNetSolutionType { get => _parametersBody.VNetSolutionType ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType)""); set => _parametersBody.VNetSolutionType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] + public string VNetSolutionType { get => _parametersBody.VNetSolutionType ?? null; set => _parametersBody.VNetSolutionType = value; } /// Backing field for property. private string _xmsServiceconnectorUserToken; @@ -396,24 +419,24 @@ public partial class NewAzServiceLinker_CreateExpanded : global::System.Manageme /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -460,6 +483,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets.NewAzServiceLink /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -524,11 +552,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -540,10 +593,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -553,7 +622,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzServiceLinker_CreateExpanded() { @@ -619,7 +688,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -629,15 +698,27 @@ protected override void ProcessRecord() Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); } // get the client instance + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("VNetSolutionDeleteOrUpdateBehavior")) + { + VNetSolutionDeleteOrUpdateBehavior = (string)this.MyInvocation.BoundParameters["VNetSolutionDeleteOrUpdateBehavior"]; + } + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("PublicNetworkSolutionDeleteOrUpdateBehavior")) + { + PublicNetworkSolutionDeleteOrUpdateBehavior = (string)this.MyInvocation.BoundParameters["PublicNetworkSolutionDeleteOrUpdateBehavior"]; + } + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("ConfigurationInfoDeleteOrUpdateBehavior")) + { + ConfigurationInfoDeleteOrUpdateBehavior = (string)this.MyInvocation.BoundParameters["ConfigurationInfoDeleteOrUpdateBehavior"]; + } try { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.LinkerCreateOrUpdate(ResourceUri, Name, this.InvocationInformation.BoundParameters.ContainsKey("XmsServiceconnectorUserToken") ? XmsServiceconnectorUserToken : null, _parametersBody, onOk, onDefault, this, Pipeline); + await this.Client.LinkerCreateOrUpdate(ResourceUri, Name, this.InvocationInformation.BoundParameters.ContainsKey("XmsServiceconnectorUserToken") ? XmsServiceconnectorUserToken : null, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri,Name=Name,XmsServiceconnectorUserToken=this.InvocationInformation.BoundParameters.ContainsKey("XmsServiceconnectorUserToken") ? XmsServiceconnectorUserToken : null,body=_parametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri,Name=Name,XmsServiceconnectorUserToken=this.InvocationInformation.BoundParameters.ContainsKey("XmsServiceconnectorUserToken") ? XmsServiceconnectorUserToken : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -675,12 +756,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -697,15 +778,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri, Name=Name, XmsServiceconnectorUserToken=this.InvocationInformation.BoundParameters.ContainsKey("XmsServiceconnectorUserToken") ? XmsServiceconnectorUserToken : null, body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri, Name=Name, XmsServiceconnectorUserToken=this.InvocationInformation.BoundParameters.ContainsKey("XmsServiceconnectorUserToken") ? XmsServiceconnectorUserToken : null, body=_parametersBody }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -715,12 +796,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -732,8 +813,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinker_CreateViaIdentityExpanded.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinker_CreateViaIdentityExpanded.cs new file mode 100644 index 000000000000..36b79d749180 --- /dev/null +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/NewAzServiceLinker_CreateViaIdentityExpanded.cs @@ -0,0 +1,825 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; + using System; + + /// create Linker resource. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzServiceLinker_CreateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Description(@"create Linker resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", ApiVersion = "2022-11-01-preview")] + public partial class NewAzServiceLinker_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// Linker of source and target resource + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerResource(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// The authentication type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The authentication type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The authentication type.", + SerializedName = @"authInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase) })] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase AuthInfo { get => _parametersBody.AuthInfo ?? null /* object */; set => _parametersBody.AuthInfo = 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.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; + + /// The application client type + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The application client type")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The application client type", + SerializedName = @"clientType", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"""none""", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] + public string ClientType { get => _parametersBody.ClientType ?? null; set => _parametersBody.ClientType = value; } + + /// + /// Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied + /// to the source application. Default is enable. If optOut, no configuration change will be made on source. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied to the source application. Default is enable. If optOut, no configuration change will be made on source.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied to the source application. Default is enable. If optOut, no configuration change will be made on source.", + SerializedName = @"action", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + public string ConfigurationInfoAction { get => _parametersBody.ConfigurationInfoAction ?? null; set => _parametersBody.ConfigurationInfoAction = value; } + + /// + /// A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this + /// property is to full fill more customized configurations + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this property is to full fill more customized configurations")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this property is to full fill more customized configurations", + SerializedName = @"additionalConfigurations", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations) })] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get => _parametersBody.ConfigurationInfoAdditionalConfiguration ?? null /* object */; set => _parametersBody.ConfigurationInfoAdditionalConfiguration = value; } + + /// + /// Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be + /// used for generate configurations + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be used for generate configurations")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be used for generate configurations", + SerializedName = @"customizedKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys) })] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get => _parametersBody.ConfigurationInfoCustomizedKey ?? null /* object */; set => _parametersBody.ConfigurationInfoCustomizedKey = value; } + + /// + /// Indicates whether to clean up previous operation when Linker is updating or deleting + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates whether to clean up previous operation when Linker is updating or deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether to clean up previous operation when Linker is updating or deleting", + SerializedName = @"deleteOrUpdateBehavior", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.DoNotExport] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + public string ConfigurationInfoDeleteOrUpdateBehavior { get => _parametersBody.ConfigurationInfoDeleteOrUpdateBehavior ?? null; set => _parametersBody.ConfigurationInfoDeleteOrUpdateBehavior = 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.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// Allow Azure services to access the target service if true. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allow Azure services to access the target service if true.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow Azure services to access the target service if true.", + SerializedName = @"azureServices", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + public string FirewallRuleAzureService { get => _parametersBody.FirewallRuleAzureService ?? null; set => _parametersBody.FirewallRuleAzureService = value; } + + /// + /// Allow caller client IP to access the target service if true. the property is used when connecting local application to + /// target service. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allow caller client IP to access the target service if true. the property is used when connecting local application to target service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow caller client IP to access the target service if true. the property is used when connecting local application to target service.", + SerializedName = @"callerClientIP", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + public string FirewallRuleCallerClientIP { get => _parametersBody.FirewallRuleCallerClientIP ?? null; set => _parametersBody.FirewallRuleCallerClientIP = value; } + + /// + /// This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client + /// IPs for a given database account. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account.", + SerializedName = @"ipRanges", + PossibleTypes = new [] { typeof(string) })] + public string[] FirewallRuleIPRange { get => _parametersBody.FirewallRuleIPRange?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.FirewallRuleIPRange = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity 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.ServiceLinker.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// Optional. Indicates public network solution. If enable, enable public network access of target service with best try. + /// Default is enable. If optOut, opt out public network access configuration. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. Indicates public network solution. If enable, enable public network access of target service with best try. Default is enable. If optOut, opt out public network access configuration.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. Indicates public network solution. If enable, enable public network access of target service with best try. Default is enable. If optOut, opt out public network access configuration.", + SerializedName = @"action", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + public string PublicNetworkSolutionAction { get => _parametersBody.PublicNetworkSolutionAction ?? null; set => _parametersBody.PublicNetworkSolutionAction = value; } + + /// + /// Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting", + SerializedName = @"deleteOrUpdateBehavior", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.DoNotExport] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + public string PublicNetworkSolutionDeleteOrUpdateBehavior { get => _parametersBody.PublicNetworkSolutionDeleteOrUpdateBehavior ?? null; set => _parametersBody.PublicNetworkSolutionDeleteOrUpdateBehavior = value; } + + /// connection scope in source service. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "connection scope in source service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"connection scope in source service.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + public string Scope { get => _parametersBody.Scope ?? null; set => _parametersBody.Scope = value; } + + /// The key vault id to store secret + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The key vault id to store secret")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The key vault id to store secret", + SerializedName = @"keyVaultId", + PossibleTypes = new [] { typeof(string) })] + public string SecretStoreKeyVaultId { get => _parametersBody.SecretStoreKeyVaultId ?? null; set => _parametersBody.SecretStoreKeyVaultId = value; } + + /// The key vault secret name to store secret, only valid when storing one secret + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The key vault secret name to store secret, only valid when storing one secret")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The key vault secret name to store secret, only valid when storing one secret", + SerializedName = @"keyVaultSecretName", + PossibleTypes = new [] { typeof(string) })] + public string SecretStoreKeyVaultSecretName { get => _parametersBody.SecretStoreKeyVaultSecretName ?? null; set => _parametersBody.SecretStoreKeyVaultSecretName = value; } + + /// The target service properties + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The target service properties")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The target service properties", + SerializedName = @"targetService", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase) })] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase TargetService { get => _parametersBody.TargetService ?? null /* object */; set => _parametersBody.TargetService = value; } + + /// + /// Indicates whether to clean up previous operation when Linker is updating or deleting + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates whether to clean up previous operation when Linker is updating or deleting")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether to clean up previous operation when Linker is updating or deleting", + SerializedName = @"deleteOrUpdateBehavior", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.DoNotExport] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + public string VNetSolutionDeleteOrUpdateBehavior { get => _parametersBody.VNetSolutionDeleteOrUpdateBehavior ?? null; set => _parametersBody.VNetSolutionDeleteOrUpdateBehavior = value; } + + /// Type of VNet solution. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of VNet solution.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of VNet solution.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] + public string VNetSolutionType { get => _parametersBody.VNetSolutionType ?? null; set => _parametersBody.VNetSolutionType = value; } + + /// Backing field for property. + private string _xmsServiceconnectorUserToken; + + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"x-ms-serviceconnector-user-token", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Header)] + public string XmsServiceconnectorUserToken { get => this._xmsServiceconnectorUserToken; set => this._xmsServiceconnectorUserToken = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzServiceLinker_CreateViaIdentityExpanded + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets.NewAzServiceLinker_CreateViaIdentityExpanded Clone() + { + var clone = new NewAzServiceLinker_CreateViaIdentityExpanded(); + 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.XmsServiceconnectorUserToken = this.XmsServiceconnectorUserToken; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"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.ServiceLinker.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzServiceLinker_CreateViaIdentityExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'LinkerCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("VNetSolutionDeleteOrUpdateBehavior")) + { + VNetSolutionDeleteOrUpdateBehavior = (string)this.MyInvocation.BoundParameters["VNetSolutionDeleteOrUpdateBehavior"]; + } + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("PublicNetworkSolutionDeleteOrUpdateBehavior")) + { + PublicNetworkSolutionDeleteOrUpdateBehavior = (string)this.MyInvocation.BoundParameters["PublicNetworkSolutionDeleteOrUpdateBehavior"]; + } + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("ConfigurationInfoDeleteOrUpdateBehavior")) + { + ConfigurationInfoDeleteOrUpdateBehavior = (string)this.MyInvocation.BoundParameters["ConfigurationInfoDeleteOrUpdateBehavior"]; + } + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.LinkerCreateOrUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("XmsServiceconnectorUserToken") ? XmsServiceconnectorUserToken : null, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceUri) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceUri"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.LinkerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.LinkerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.LinkerCreateOrUpdate(InputObject.ResourceUri ?? null, InputObject.LinkerName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("XmsServiceconnectorUserToken") ? XmsServiceconnectorUserToken : null, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { XmsServiceconnectorUserToken=this.InvocationInformation.BoundParameters.ContainsKey("XmsServiceconnectorUserToken") ? XmsServiceconnectorUserToken : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.ServiceLinker.Models.ILinkerResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/RemoveAzServiceLinkerDryrun_Delete.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/RemoveAzServiceLinkerDryrun_Delete.cs index 6fd7b9b2eb89..4196b394f402 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/RemoveAzServiceLinkerDryrun_Delete.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/RemoveAzServiceLinkerDryrun_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; using System; /// delete a dryrun job @@ -19,7 +21,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}", ApiVersion = "2022-11-01-preview")] public partial class RemoveAzServiceLinkerDryrun_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class RemoveAzServiceLinkerDryrun_Delete : global::System.Managem /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; @@ -67,6 +85,9 @@ public partial class RemoveAzServiceLinkerDryrun_Delete : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Path)] public string DryrunName { get => this._dryrunName; set => this._dryrunName = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -100,7 +121,7 @@ public partial class RemoveAzServiceLinkerDryrun_Delete : global::System.Managem /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -139,12 +160,12 @@ public partial class RemoveAzServiceLinkerDryrun_Delete : global::System.Managem /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -187,6 +208,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -251,8 +277,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -308,7 +359,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -326,7 +377,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri,DryrunName=DryrunName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri,DryrunName=DryrunName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -339,7 +390,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzServiceLinkerDryrun_Delete() { @@ -372,12 +423,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -394,15 +445,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri, DryrunName=DryrunName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri, DryrunName=DryrunName }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/RemoveAzServiceLinkerDryrun_DeleteViaIdentity.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/RemoveAzServiceLinkerDryrun_DeleteViaIdentity.cs index 6497a776d67f..9e647b7bf155 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/RemoveAzServiceLinkerDryrun_DeleteViaIdentity.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/RemoveAzServiceLinkerDryrun_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; using System; /// delete a dryrun job @@ -19,7 +21,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}", ApiVersion = "2022-11-01-preview")] public partial class RemoveAzServiceLinkerDryrun_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class RemoveAzServiceLinkerDryrun_DeleteViaIdentity : global::Sys /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class RemoveAzServiceLinkerDryrun_DeleteViaIdentity : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -94,7 +115,7 @@ public partial class RemoveAzServiceLinkerDryrun_DeleteViaIdentity : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -117,12 +138,12 @@ public partial class RemoveAzServiceLinkerDryrun_DeleteViaIdentity : global::Sys /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -165,6 +186,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -229,8 +255,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -286,7 +337,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -320,7 +371,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -333,7 +384,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzServiceLinkerDryrun_DeleteViaIdentity() { @@ -366,12 +417,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -388,7 +439,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/RemoveAzServiceLinker_Delete.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/RemoveAzServiceLinker_Delete.cs index 30dc4d928153..b95a1339c79a 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/RemoveAzServiceLinker_Delete.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/RemoveAzServiceLinker_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; using System; /// Delete a Linker. @@ -19,7 +21,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", ApiVersion = "2022-11-01-preview")] public partial class RemoveAzServiceLinker_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,6 +38,18 @@ public partial class RemoveAzServiceLinker_Delete : global::System.Management.Au /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] @@ -45,6 +60,9 @@ public partial class RemoveAzServiceLinker_Delete : global::System.Management.Au [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class RemoveAzServiceLinker_Delete : global::System.Management.Au [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -114,7 +135,7 @@ public partial class RemoveAzServiceLinker_Delete : global::System.Management.Au /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -153,12 +174,12 @@ public partial class RemoveAzServiceLinker_Delete : global::System.Management.Au /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -223,6 +244,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets.RemoveAzServiceL /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -287,11 +313,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -303,10 +354,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -374,7 +441,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -392,7 +459,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -405,7 +472,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzServiceLinker_Delete() { @@ -438,12 +505,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -460,15 +527,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/RemoveAzServiceLinker_DeleteViaIdentity.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/RemoveAzServiceLinker_DeleteViaIdentity.cs index 37d51e2238c1..94991d3a2905 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/RemoveAzServiceLinker_DeleteViaIdentity.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/RemoveAzServiceLinker_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; using System; /// Delete a Linker. @@ -19,7 +21,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", ApiVersion = "2022-11-01-preview")] public partial class RemoveAzServiceLinker_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,6 +38,18 @@ public partial class RemoveAzServiceLinker_DeleteViaIdentity : global::System.Ma /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] @@ -45,6 +60,9 @@ public partial class RemoveAzServiceLinker_DeleteViaIdentity : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class RemoveAzServiceLinker_DeleteViaIdentity : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -107,7 +128,7 @@ public partial class RemoveAzServiceLinker_DeleteViaIdentity : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -130,12 +151,12 @@ public partial class RemoveAzServiceLinker_DeleteViaIdentity : global::System.Ma /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -198,6 +219,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets.RemoveAzServiceL /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -262,11 +288,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -278,10 +329,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -349,7 +416,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -383,7 +450,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -396,7 +463,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzServiceLinker_DeleteViaIdentity() { @@ -429,12 +496,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -451,7 +518,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/TestAzServiceLinker_Validate.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/TestAzServiceLinker_Validate.cs index 8b6c12c4366c..fbc07477c728 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/TestAzServiceLinker_Validate.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/TestAzServiceLinker_Validate.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; using System; /// Validate a Linker. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzServiceLinker_Validate", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResult))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResult))] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Description(@"Validate a Linker.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker", ApiVersion = "2022-11-01-preview")] public partial class TestAzServiceLinker_Validate : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,6 +38,18 @@ public partial class TestAzServiceLinker_Validate : global::System.Management.Au /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] @@ -45,6 +60,9 @@ public partial class TestAzServiceLinker_Validate : global::System.Management.Au [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class TestAzServiceLinker_Validate : global::System.Management.Au [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -107,7 +128,7 @@ public partial class TestAzServiceLinker_Validate : global::System.Management.Au /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -146,24 +167,24 @@ public partial class TestAzServiceLinker_Validate : global::System.Management.Au /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -208,6 +229,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets.TestAzServiceLin /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -272,11 +298,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -288,10 +339,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -359,7 +426,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -377,7 +444,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -397,7 +464,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public TestAzServiceLinker_Validate() { @@ -423,12 +490,12 @@ public TestAzServiceLinker_Validate() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -445,15 +512,15 @@ public TestAzServiceLinker_Validate() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -463,12 +530,12 @@ public TestAzServiceLinker_Validate() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -480,8 +547,26 @@ public TestAzServiceLinker_Validate() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResult - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResult + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/TestAzServiceLinker_ValidateViaIdentity.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/TestAzServiceLinker_ValidateViaIdentity.cs index 090ece5f95dc..ad054bbb66ed 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/TestAzServiceLinker_ValidateViaIdentity.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/TestAzServiceLinker_ValidateViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; using System; /// Validate a Linker. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzServiceLinker_ValidateViaIdentity", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResult))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResult))] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Description(@"Validate a Linker.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker", ApiVersion = "2022-11-01-preview")] public partial class TestAzServiceLinker_ValidateViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,6 +38,18 @@ public partial class TestAzServiceLinker_ValidateViaIdentity : global::System.Ma /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] @@ -45,6 +60,9 @@ public partial class TestAzServiceLinker_ValidateViaIdentity : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class TestAzServiceLinker_ValidateViaIdentity : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -100,7 +121,7 @@ public partial class TestAzServiceLinker_ValidateViaIdentity : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -123,24 +144,24 @@ public partial class TestAzServiceLinker_ValidateViaIdentity : global::System.Ma /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -183,6 +204,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets.TestAzServiceLin /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -247,11 +273,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -263,10 +314,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -334,7 +401,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -368,7 +435,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -388,7 +455,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public TestAzServiceLinker_ValidateViaIdentity() { @@ -414,12 +481,12 @@ public TestAzServiceLinker_ValidateViaIdentity() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -436,7 +503,7 @@ public TestAzServiceLinker_ValidateViaIdentity() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -454,12 +521,12 @@ public TestAzServiceLinker_ValidateViaIdentity() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -471,8 +538,26 @@ public TestAzServiceLinker_ValidateViaIdentity() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResult - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResult + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/UpdateAzServiceLinkerDryrun_UpdateExpanded.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/UpdateAzServiceLinkerDryrun_UpdateExpanded.cs index ec5656e1f436..80a3ea12c3a2 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/UpdateAzServiceLinkerDryrun_UpdateExpanded.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/UpdateAzServiceLinkerDryrun_UpdateExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; using System; /// add a dryrun job to do necessary check before actual creation @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzServiceLinkerDryrun_UpdateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Description(@"add a dryrun job to do necessary check before actual creation")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}", ApiVersion = "2022-11-01-preview")] public partial class UpdateAzServiceLinkerDryrun_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +38,20 @@ public partial class UpdateAzServiceLinkerDryrun_UpdateExpanded : global::System /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// a dryrun job to be updated. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatch _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunPatch(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatch _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunPatch(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -48,6 +63,9 @@ public partial class UpdateAzServiceLinkerDryrun_UpdateExpanded : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; @@ -75,6 +93,9 @@ public partial class UpdateAzServiceLinkerDryrun_UpdateExpanded : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Path)] public string DryrunName { get => this._dryrunName; set => this._dryrunName = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -109,7 +130,7 @@ public partial class UpdateAzServiceLinkerDryrun_UpdateExpanded : global::System /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -148,24 +169,24 @@ public partial class UpdateAzServiceLinkerDryrun_UpdateExpanded : global::System /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -211,6 +232,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets.UpdateAzServiceL /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -275,11 +301,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -291,10 +342,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -362,7 +429,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -375,12 +442,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.LinkersUpdateDryrun(ResourceUri, DryrunName, _parametersBody, onOk, onDefault, this, Pipeline); + await this.Client.LinkersUpdateDryrun(ResourceUri, DryrunName, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri,DryrunName=DryrunName,body=_parametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri,DryrunName=DryrunName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -400,7 +467,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzServiceLinkerDryrun_UpdateExpanded() { @@ -426,12 +493,12 @@ public UpdateAzServiceLinkerDryrun_UpdateExpanded() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -448,15 +515,15 @@ public UpdateAzServiceLinkerDryrun_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri, DryrunName=DryrunName, body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri, DryrunName=DryrunName, body=_parametersBody }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -466,12 +533,12 @@ public UpdateAzServiceLinkerDryrun_UpdateExpanded() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -483,8 +550,26 @@ public UpdateAzServiceLinkerDryrun_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/UpdateAzServiceLinkerDryrun_UpdateViaIdentityExpanded.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/UpdateAzServiceLinkerDryrun_UpdateViaIdentityExpanded.cs index 8f479551409e..fd8c89e849f0 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/UpdateAzServiceLinkerDryrun_UpdateViaIdentityExpanded.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/UpdateAzServiceLinkerDryrun_UpdateViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; using System; /// add a dryrun job to do necessary check before actual creation @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzServiceLinkerDryrun_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Description(@"add a dryrun job to do necessary check before actual creation")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}", ApiVersion = "2022-11-01-preview")] public partial class UpdateAzServiceLinkerDryrun_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +38,20 @@ public partial class UpdateAzServiceLinkerDryrun_UpdateViaIdentityExpanded : glo /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// a dryrun job to be updated. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunPatch _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.DryrunPatch(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunPatch _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.DryrunPatch(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -48,6 +63,9 @@ public partial class UpdateAzServiceLinkerDryrun_UpdateViaIdentityExpanded : glo [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; @@ -61,6 +79,9 @@ public partial class UpdateAzServiceLinkerDryrun_UpdateViaIdentityExpanded : glo [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -103,7 +124,7 @@ public partial class UpdateAzServiceLinkerDryrun_UpdateViaIdentityExpanded : glo /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -126,24 +147,24 @@ public partial class UpdateAzServiceLinkerDryrun_UpdateViaIdentityExpanded : glo /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -187,6 +208,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets.UpdateAzServiceL /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -251,11 +277,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -267,10 +318,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -338,7 +405,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -353,7 +420,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.LinkersUpdateDryrunViaIdentity(InputObject.Id, _parametersBody, onOk, onDefault, this, Pipeline); + await this.Client.LinkersUpdateDryrunViaIdentity(InputObject.Id, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate); } else { @@ -366,13 +433,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DryrunName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.LinkersUpdateDryrun(InputObject.ResourceUri ?? null, InputObject.DryrunName ?? null, _parametersBody, onOk, onDefault, this, Pipeline); + await this.Client.LinkersUpdateDryrun(InputObject.ResourceUri ?? null, InputObject.DryrunName ?? null, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -392,7 +459,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzServiceLinkerDryrun_UpdateViaIdentityExpanded() { @@ -418,12 +485,12 @@ public UpdateAzServiceLinkerDryrun_UpdateViaIdentityExpanded() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -440,15 +507,15 @@ public UpdateAzServiceLinkerDryrun_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -458,12 +525,12 @@ public UpdateAzServiceLinkerDryrun_UpdateViaIdentityExpanded() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -475,8 +542,26 @@ public UpdateAzServiceLinkerDryrun_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/UpdateAzServiceLinker_UpdateExpanded.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/UpdateAzServiceLinker_UpdateExpanded.cs index 1aba66617beb..b2580a03d777 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/UpdateAzServiceLinker_UpdateExpanded.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/UpdateAzServiceLinker_UpdateExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; using System; /// Operation to update an existing Linker. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzServiceLinker_UpdateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Description(@"Operation to update an existing Linker.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", ApiVersion = "2022-11-01-preview")] public partial class UpdateAzServiceLinker_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +38,20 @@ public partial class UpdateAzServiceLinker_UpdateExpanded : global::System.Manag /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A Linker to be updated. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatch _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerPatch(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatch _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerPatch(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -51,14 +66,17 @@ public partial class UpdateAzServiceLinker_UpdateExpanded : global::System.Manag ReadOnly = false, Description = @"The authentication type.", SerializedName = @"authInfo", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase) })] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase AuthInfo { get => _parametersBody.AuthInfo ?? null /* object */; set => _parametersBody.AuthInfo = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase) })] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase AuthInfo { get => _parametersBody.AuthInfo ?? null /* object */; set => _parametersBody.AuthInfo = 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.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; @@ -70,9 +88,9 @@ public partial class UpdateAzServiceLinker_UpdateExpanded : global::System.Manag ReadOnly = false, Description = @"The application client type", SerializedName = @"clientType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType ClientType { get => _parametersBody.ClientType ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType)""); set => _parametersBody.ClientType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] + public string ClientType { get => _parametersBody.ClientType ?? null; set => _parametersBody.ClientType = value; } /// /// Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied @@ -85,9 +103,9 @@ public partial class UpdateAzServiceLinker_UpdateExpanded : global::System.Manag ReadOnly = false, Description = @"Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied to the source application. Default is enable. If optOut, no configuration change will be made on source.", SerializedName = @"action", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType ConfigurationInfoAction { get => _parametersBody.ConfigurationInfoAction ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType)""); set => _parametersBody.ConfigurationInfoAction = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + public string ConfigurationInfoAction { get => _parametersBody.ConfigurationInfoAction ?? null; set => _parametersBody.ConfigurationInfoAction = value; } /// /// A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this @@ -101,8 +119,8 @@ public partial class UpdateAzServiceLinker_UpdateExpanded : global::System.Manag ReadOnly = false, Description = @"A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this property is to full fill more customized configurations", SerializedName = @"additionalConfigurations", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations) })] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get => _parametersBody.ConfigurationInfoAdditionalConfiguration ?? null /* object */; set => _parametersBody.ConfigurationInfoAdditionalConfiguration = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations) })] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get => _parametersBody.ConfigurationInfoAdditionalConfiguration ?? null /* object */; set => _parametersBody.ConfigurationInfoAdditionalConfiguration = value; } /// /// Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be @@ -116,8 +134,8 @@ public partial class UpdateAzServiceLinker_UpdateExpanded : global::System.Manag ReadOnly = false, Description = @"Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be used for generate configurations", SerializedName = @"customizedKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys) })] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get => _parametersBody.ConfigurationInfoCustomizedKey ?? null /* object */; set => _parametersBody.ConfigurationInfoCustomizedKey = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys) })] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get => _parametersBody.ConfigurationInfoCustomizedKey ?? null /* object */; set => _parametersBody.ConfigurationInfoCustomizedKey = value; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting @@ -129,10 +147,10 @@ public partial class UpdateAzServiceLinker_UpdateExpanded : global::System.Manag ReadOnly = false, Description = @"Indicates whether to clean up previous operation when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] + PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.DoNotExport] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior ConfigurationInfoDeleteOrUpdateBehavior { get => _parametersBody.ConfigurationInfoDeleteOrUpdateBehavior ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior)""); set => _parametersBody.ConfigurationInfoDeleteOrUpdateBehavior = value; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + public string ConfigurationInfoDeleteOrUpdateBehavior { get => _parametersBody.ConfigurationInfoDeleteOrUpdateBehavior ?? null; set => _parametersBody.ConfigurationInfoDeleteOrUpdateBehavior = value; } /// /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet @@ -144,6 +162,9 @@ public partial class UpdateAzServiceLinker_UpdateExpanded : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Allow Azure services to access the target service if true. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allow Azure services to access the target service if true.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Body)] @@ -152,9 +173,9 @@ public partial class UpdateAzServiceLinker_UpdateExpanded : global::System.Manag ReadOnly = false, Description = @"Allow Azure services to access the target service if true.", SerializedName = @"azureServices", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType FirewallRuleAzureService { get => _parametersBody.FirewallRuleAzureService ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType)""); set => _parametersBody.FirewallRuleAzureService = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + public string FirewallRuleAzureService { get => _parametersBody.FirewallRuleAzureService ?? null; set => _parametersBody.FirewallRuleAzureService = value; } /// /// Allow caller client IP to access the target service if true. the property is used when connecting local application to @@ -167,9 +188,9 @@ public partial class UpdateAzServiceLinker_UpdateExpanded : global::System.Manag ReadOnly = false, Description = @"Allow caller client IP to access the target service if true. the property is used when connecting local application to target service.", SerializedName = @"callerClientIP", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType FirewallRuleCallerClientIP { get => _parametersBody.FirewallRuleCallerClientIP ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType)""); set => _parametersBody.FirewallRuleCallerClientIP = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + public string FirewallRuleCallerClientIP { get => _parametersBody.FirewallRuleCallerClientIP ?? null; set => _parametersBody.FirewallRuleCallerClientIP = value; } /// /// This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client @@ -184,7 +205,7 @@ public partial class UpdateAzServiceLinker_UpdateExpanded : global::System.Manag Description = @"This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account.", SerializedName = @"ipRanges", PossibleTypes = new [] { typeof(string) })] - public string[] FirewallRuleIPRange { get => _parametersBody.FirewallRuleIPRange ?? null /* arrayOf */; set => _parametersBody.FirewallRuleIPRange = value; } + public string[] FirewallRuleIPRange { get => _parametersBody.FirewallRuleIPRange?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.FirewallRuleIPRange = (value != null ? new System.Collections.Generic.List(value) : null); } /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] @@ -235,7 +256,7 @@ public partial class UpdateAzServiceLinker_UpdateExpanded : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -264,9 +285,9 @@ public partial class UpdateAzServiceLinker_UpdateExpanded : global::System.Manag ReadOnly = false, Description = @"Optional. Indicates public network solution. If enable, enable public network access of target service with best try. Default is enable. If optOut, opt out public network access configuration.", SerializedName = @"action", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType PublicNetworkSolutionAction { get => _parametersBody.PublicNetworkSolutionAction ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType)""); set => _parametersBody.PublicNetworkSolutionAction = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + public string PublicNetworkSolutionAction { get => _parametersBody.PublicNetworkSolutionAction ?? null; set => _parametersBody.PublicNetworkSolutionAction = value; } /// /// Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting @@ -278,10 +299,10 @@ public partial class UpdateAzServiceLinker_UpdateExpanded : global::System.Manag ReadOnly = false, Description = @"Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] + PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.DoNotExport] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior PublicNetworkSolutionDeleteOrUpdateBehavior { get => _parametersBody.PublicNetworkSolutionDeleteOrUpdateBehavior ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior)""); set => _parametersBody.PublicNetworkSolutionDeleteOrUpdateBehavior = value; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + public string PublicNetworkSolutionDeleteOrUpdateBehavior { get => _parametersBody.PublicNetworkSolutionDeleteOrUpdateBehavior ?? null; set => _parametersBody.PublicNetworkSolutionDeleteOrUpdateBehavior = value; } /// Backing field for property. private string _resourceUri; @@ -340,8 +361,8 @@ public partial class UpdateAzServiceLinker_UpdateExpanded : global::System.Manag ReadOnly = false, Description = @"The target service properties", SerializedName = @"targetService", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase) })] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase TargetService { get => _parametersBody.TargetService ?? null /* object */; set => _parametersBody.TargetService = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase) })] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase TargetService { get => _parametersBody.TargetService ?? null /* object */; set => _parametersBody.TargetService = value; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting @@ -353,10 +374,10 @@ public partial class UpdateAzServiceLinker_UpdateExpanded : global::System.Manag ReadOnly = false, Description = @"Indicates whether to clean up previous operation when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] + PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.DoNotExport] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior VNetSolutionDeleteOrUpdateBehavior { get => _parametersBody.VNetSolutionDeleteOrUpdateBehavior ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior)""); set => _parametersBody.VNetSolutionDeleteOrUpdateBehavior = value; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + public string VNetSolutionDeleteOrUpdateBehavior { get => _parametersBody.VNetSolutionDeleteOrUpdateBehavior ?? null; set => _parametersBody.VNetSolutionDeleteOrUpdateBehavior = value; } /// Type of VNet solution. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of VNet solution.")] @@ -366,9 +387,9 @@ public partial class UpdateAzServiceLinker_UpdateExpanded : global::System.Manag ReadOnly = false, Description = @"Type of VNet solution.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType VNetSolutionType { get => _parametersBody.VNetSolutionType ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType)""); set => _parametersBody.VNetSolutionType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] + public string VNetSolutionType { get => _parametersBody.VNetSolutionType ?? null; set => _parametersBody.VNetSolutionType = value; } /// Backing field for property. private string _xmsServiceconnectorUserToken; @@ -388,24 +409,24 @@ public partial class UpdateAzServiceLinker_UpdateExpanded : global::System.Manag /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -452,6 +473,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets.UpdateAzServiceL /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -516,11 +542,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -532,10 +583,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -603,7 +670,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -613,15 +680,27 @@ protected override void ProcessRecord() Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); } // get the client instance + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("VNetSolutionDeleteOrUpdateBehavior")) + { + VNetSolutionDeleteOrUpdateBehavior = (string)this.MyInvocation.BoundParameters["VNetSolutionDeleteOrUpdateBehavior"]; + } + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("PublicNetworkSolutionDeleteOrUpdateBehavior")) + { + PublicNetworkSolutionDeleteOrUpdateBehavior = (string)this.MyInvocation.BoundParameters["PublicNetworkSolutionDeleteOrUpdateBehavior"]; + } + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("ConfigurationInfoDeleteOrUpdateBehavior")) + { + ConfigurationInfoDeleteOrUpdateBehavior = (string)this.MyInvocation.BoundParameters["ConfigurationInfoDeleteOrUpdateBehavior"]; + } try { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.LinkerUpdate(ResourceUri, Name, this.InvocationInformation.BoundParameters.ContainsKey("XmsServiceconnectorUserToken") ? XmsServiceconnectorUserToken : null, _parametersBody, onOk, onDefault, this, Pipeline); + await this.Client.LinkerUpdate(ResourceUri, Name, this.InvocationInformation.BoundParameters.ContainsKey("XmsServiceconnectorUserToken") ? XmsServiceconnectorUserToken : null, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri,Name=Name,XmsServiceconnectorUserToken=this.InvocationInformation.BoundParameters.ContainsKey("XmsServiceconnectorUserToken") ? XmsServiceconnectorUserToken : null,body=_parametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri,Name=Name,XmsServiceconnectorUserToken=this.InvocationInformation.BoundParameters.ContainsKey("XmsServiceconnectorUserToken") ? XmsServiceconnectorUserToken : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -641,7 +720,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzServiceLinker_UpdateExpanded() { @@ -667,12 +746,12 @@ public UpdateAzServiceLinker_UpdateExpanded() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -689,15 +768,15 @@ public UpdateAzServiceLinker_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri, Name=Name, XmsServiceconnectorUserToken=this.InvocationInformation.BoundParameters.ContainsKey("XmsServiceconnectorUserToken") ? XmsServiceconnectorUserToken : null, body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceUri=ResourceUri, Name=Name, XmsServiceconnectorUserToken=this.InvocationInformation.BoundParameters.ContainsKey("XmsServiceconnectorUserToken") ? XmsServiceconnectorUserToken : null, body=_parametersBody }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -707,12 +786,12 @@ public UpdateAzServiceLinker_UpdateExpanded() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -724,8 +803,26 @@ public UpdateAzServiceLinker_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/UpdateAzServiceLinker_UpdateViaIdentityExpanded.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/UpdateAzServiceLinker_UpdateViaIdentityExpanded.cs index f7e4ba49c695..fcea55d1d59e 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/UpdateAzServiceLinker_UpdateViaIdentityExpanded.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/cmdlets/UpdateAzServiceLinker_UpdateViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets; using System; /// Operation to update an existing Linker. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzServiceLinker_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Description(@"Operation to update an existing Linker.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.HttpPath(Path = "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}", ApiVersion = "2022-11-01-preview")] public partial class UpdateAzServiceLinker_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +38,20 @@ public partial class UpdateAzServiceLinker_UpdateViaIdentityExpanded : global::S /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A Linker to be updated. - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerPatch _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.LinkerPatch(); + private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerPatch _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.LinkerPatch(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -51,14 +66,17 @@ public partial class UpdateAzServiceLinker_UpdateViaIdentityExpanded : global::S ReadOnly = false, Description = @"The authentication type.", SerializedName = @"authInfo", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase) })] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase AuthInfo { get => _parametersBody.AuthInfo ?? null /* object */; set => _parametersBody.AuthInfo = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase) })] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase AuthInfo { get => _parametersBody.AuthInfo ?? null /* object */; set => _parametersBody.AuthInfo = 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.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.ClientAPI; @@ -70,9 +88,9 @@ public partial class UpdateAzServiceLinker_UpdateViaIdentityExpanded : global::S ReadOnly = false, Description = @"The application client type", SerializedName = @"clientType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType ClientType { get => _parametersBody.ClientType ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType)""); set => _parametersBody.ClientType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] + public string ClientType { get => _parametersBody.ClientType ?? null; set => _parametersBody.ClientType = value; } /// /// Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied @@ -85,9 +103,9 @@ public partial class UpdateAzServiceLinker_UpdateViaIdentityExpanded : global::S ReadOnly = false, Description = @"Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied to the source application. Default is enable. If optOut, no configuration change will be made on source.", SerializedName = @"action", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType ConfigurationInfoAction { get => _parametersBody.ConfigurationInfoAction ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType)""); set => _parametersBody.ConfigurationInfoAction = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + public string ConfigurationInfoAction { get => _parametersBody.ConfigurationInfoAction ?? null; set => _parametersBody.ConfigurationInfoAction = value; } /// /// A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this @@ -101,8 +119,8 @@ public partial class UpdateAzServiceLinker_UpdateViaIdentityExpanded : global::S ReadOnly = false, Description = @"A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this property is to full fill more customized configurations", SerializedName = @"additionalConfigurations", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations) })] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get => _parametersBody.ConfigurationInfoAdditionalConfiguration ?? null /* object */; set => _parametersBody.ConfigurationInfoAdditionalConfiguration = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations) })] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations ConfigurationInfoAdditionalConfiguration { get => _parametersBody.ConfigurationInfoAdditionalConfiguration ?? null /* object */; set => _parametersBody.ConfigurationInfoAdditionalConfiguration = value; } /// /// Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be @@ -116,8 +134,8 @@ public partial class UpdateAzServiceLinker_UpdateViaIdentityExpanded : global::S ReadOnly = false, Description = @"Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be used for generate configurations", SerializedName = @"customizedKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys) })] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get => _parametersBody.ConfigurationInfoCustomizedKey ?? null /* object */; set => _parametersBody.ConfigurationInfoCustomizedKey = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys) })] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys ConfigurationInfoCustomizedKey { get => _parametersBody.ConfigurationInfoCustomizedKey ?? null /* object */; set => _parametersBody.ConfigurationInfoCustomizedKey = value; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting @@ -129,10 +147,10 @@ public partial class UpdateAzServiceLinker_UpdateViaIdentityExpanded : global::S ReadOnly = false, Description = @"Indicates whether to clean up previous operation when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] + PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.DoNotExport] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior ConfigurationInfoDeleteOrUpdateBehavior { get => _parametersBody.ConfigurationInfoDeleteOrUpdateBehavior ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior)""); set => _parametersBody.ConfigurationInfoDeleteOrUpdateBehavior = value; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + public string ConfigurationInfoDeleteOrUpdateBehavior { get => _parametersBody.ConfigurationInfoDeleteOrUpdateBehavior ?? null; set => _parametersBody.ConfigurationInfoDeleteOrUpdateBehavior = value; } /// /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet @@ -144,6 +162,9 @@ public partial class UpdateAzServiceLinker_UpdateViaIdentityExpanded : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Allow Azure services to access the target service if true. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allow Azure services to access the target service if true.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ParameterCategory.Body)] @@ -152,9 +173,9 @@ public partial class UpdateAzServiceLinker_UpdateViaIdentityExpanded : global::S ReadOnly = false, Description = @"Allow Azure services to access the target service if true.", SerializedName = @"azureServices", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType FirewallRuleAzureService { get => _parametersBody.FirewallRuleAzureService ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType)""); set => _parametersBody.FirewallRuleAzureService = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + public string FirewallRuleAzureService { get => _parametersBody.FirewallRuleAzureService ?? null; set => _parametersBody.FirewallRuleAzureService = value; } /// /// Allow caller client IP to access the target service if true. the property is used when connecting local application to @@ -167,9 +188,9 @@ public partial class UpdateAzServiceLinker_UpdateViaIdentityExpanded : global::S ReadOnly = false, Description = @"Allow caller client IP to access the target service if true. the property is used when connecting local application to target service.", SerializedName = @"callerClientIP", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType FirewallRuleCallerClientIP { get => _parametersBody.FirewallRuleCallerClientIP ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType)""); set => _parametersBody.FirewallRuleCallerClientIP = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] + public string FirewallRuleCallerClientIP { get => _parametersBody.FirewallRuleCallerClientIP ?? null; set => _parametersBody.FirewallRuleCallerClientIP = value; } /// /// This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client @@ -184,7 +205,7 @@ public partial class UpdateAzServiceLinker_UpdateViaIdentityExpanded : global::S Description = @"This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account.", SerializedName = @"ipRanges", PossibleTypes = new [] { typeof(string) })] - public string[] FirewallRuleIPRange { get => _parametersBody.FirewallRuleIPRange ?? null /* arrayOf */; set => _parametersBody.FirewallRuleIPRange = value; } + public string[] FirewallRuleIPRange { get => _parametersBody.FirewallRuleIPRange?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.FirewallRuleIPRange = (value != null ? new System.Collections.Generic.List(value) : null); } /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] @@ -228,7 +249,7 @@ public partial class UpdateAzServiceLinker_UpdateViaIdentityExpanded : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -257,9 +278,9 @@ public partial class UpdateAzServiceLinker_UpdateViaIdentityExpanded : global::S ReadOnly = false, Description = @"Optional. Indicates public network solution. If enable, enable public network access of target service with best try. Default is enable. If optOut, opt out public network access configuration.", SerializedName = @"action", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType PublicNetworkSolutionAction { get => _parametersBody.PublicNetworkSolutionAction ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType)""); set => _parametersBody.PublicNetworkSolutionAction = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] + public string PublicNetworkSolutionAction { get => _parametersBody.PublicNetworkSolutionAction ?? null; set => _parametersBody.PublicNetworkSolutionAction = value; } /// /// Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting @@ -271,10 +292,10 @@ public partial class UpdateAzServiceLinker_UpdateViaIdentityExpanded : global::S ReadOnly = false, Description = @"Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] + PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.DoNotExport] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior PublicNetworkSolutionDeleteOrUpdateBehavior { get => _parametersBody.PublicNetworkSolutionDeleteOrUpdateBehavior ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior)""); set => _parametersBody.PublicNetworkSolutionDeleteOrUpdateBehavior = value; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + public string PublicNetworkSolutionDeleteOrUpdateBehavior { get => _parametersBody.PublicNetworkSolutionDeleteOrUpdateBehavior ?? null; set => _parametersBody.PublicNetworkSolutionDeleteOrUpdateBehavior = value; } /// connection scope in source service. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "connection scope in source service.")] @@ -317,8 +338,8 @@ public partial class UpdateAzServiceLinker_UpdateViaIdentityExpanded : global::S ReadOnly = false, Description = @"The target service properties", SerializedName = @"targetService", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase) })] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase TargetService { get => _parametersBody.TargetService ?? null /* object */; set => _parametersBody.TargetService = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase) })] + public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase TargetService { get => _parametersBody.TargetService ?? null /* object */; set => _parametersBody.TargetService = value; } /// /// Indicates whether to clean up previous operation when Linker is updating or deleting @@ -330,10 +351,10 @@ public partial class UpdateAzServiceLinker_UpdateViaIdentityExpanded : global::S ReadOnly = false, Description = @"Indicates whether to clean up previous operation when Linker is updating or deleting", SerializedName = @"deleteOrUpdateBehavior", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior) })] + PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.DoNotExport] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior VNetSolutionDeleteOrUpdateBehavior { get => _parametersBody.VNetSolutionDeleteOrUpdateBehavior ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.DeleteOrUpdateBehavior)""); set => _parametersBody.VNetSolutionDeleteOrUpdateBehavior = value; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Default", "ForcedCleanup")] + public string VNetSolutionDeleteOrUpdateBehavior { get => _parametersBody.VNetSolutionDeleteOrUpdateBehavior ?? null; set => _parametersBody.VNetSolutionDeleteOrUpdateBehavior = value; } /// Type of VNet solution. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of VNet solution.")] @@ -343,9 +364,9 @@ public partial class UpdateAzServiceLinker_UpdateViaIdentityExpanded : global::S ReadOnly = false, Description = @"Type of VNet solution.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType))] - public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType VNetSolutionType { get => _parametersBody.VNetSolutionType ?? ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType)""); set => _parametersBody.VNetSolutionType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] + public string VNetSolutionType { get => _parametersBody.VNetSolutionType ?? null; set => _parametersBody.VNetSolutionType = value; } /// Backing field for property. private string _xmsServiceconnectorUserToken; @@ -365,24 +386,24 @@ public partial class UpdateAzServiceLinker_UpdateViaIdentityExpanded : global::S /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -427,6 +448,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Cmdlets.UpdateAzServiceL /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -491,11 +517,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -507,10 +558,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -578,7 +645,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -588,12 +655,24 @@ protected override void ProcessRecord() Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); } // get the client instance + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("VNetSolutionDeleteOrUpdateBehavior")) + { + VNetSolutionDeleteOrUpdateBehavior = (string)this.MyInvocation.BoundParameters["VNetSolutionDeleteOrUpdateBehavior"]; + } + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("PublicNetworkSolutionDeleteOrUpdateBehavior")) + { + PublicNetworkSolutionDeleteOrUpdateBehavior = (string)this.MyInvocation.BoundParameters["PublicNetworkSolutionDeleteOrUpdateBehavior"]; + } + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("ConfigurationInfoDeleteOrUpdateBehavior")) + { + ConfigurationInfoDeleteOrUpdateBehavior = (string)this.MyInvocation.BoundParameters["ConfigurationInfoDeleteOrUpdateBehavior"]; + } try { await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.LinkerUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("XmsServiceconnectorUserToken") ? XmsServiceconnectorUserToken : null, _parametersBody, onOk, onDefault, this, Pipeline); + await this.Client.LinkerUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("XmsServiceconnectorUserToken") ? XmsServiceconnectorUserToken : null, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate); } else { @@ -606,13 +685,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.LinkerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.LinkerUpdate(InputObject.ResourceUri ?? null, InputObject.LinkerName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("XmsServiceconnectorUserToken") ? XmsServiceconnectorUserToken : null, _parametersBody, onOk, onDefault, this, Pipeline); + await this.Client.LinkerUpdate(InputObject.ResourceUri ?? null, InputObject.LinkerName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("XmsServiceconnectorUserToken") ? XmsServiceconnectorUserToken : null, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { XmsServiceconnectorUserToken=this.InvocationInformation.BoundParameters.ContainsKey("XmsServiceconnectorUserToken") ? XmsServiceconnectorUserToken : null,body=_parametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { XmsServiceconnectorUserToken=this.InvocationInformation.BoundParameters.ContainsKey("XmsServiceconnectorUserToken") ? XmsServiceconnectorUserToken : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -632,7 +711,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzServiceLinker_UpdateViaIdentityExpanded() { @@ -658,12 +737,12 @@ public UpdateAzServiceLinker_UpdateViaIdentityExpanded() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -680,15 +759,15 @@ public UpdateAzServiceLinker_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { XmsServiceconnectorUserToken=this.InvocationInformation.BoundParameters.ContainsKey("XmsServiceconnectorUserToken") ? XmsServiceconnectorUserToken : null, body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { XmsServiceconnectorUserToken=this.InvocationInformation.BoundParameters.ContainsKey("XmsServiceconnectorUserToken") ? XmsServiceconnectorUserToken : null, body=_parametersBody }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -698,12 +777,12 @@ public UpdateAzServiceLinker_UpdateViaIdentityExpanded() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -715,8 +794,26 @@ public UpdateAzServiceLinker_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs new file mode 100644 index 000000000000..7b062b822fa0 --- /dev/null +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker +{ + using System; + using System.Collections.Generic; + using System.Text; + + [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)] + public class ExternalDocsAttribute : Attribute + { + + public string Description { get; } + + public string Url { get; } + + public ExternalDocsAttribute(string url) + { + Url = url; + } + + public ExternalDocsAttribute(string url, string description) + { + Url = url; + Description = description; + } + } +} diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs new file mode 100644 index 000000000000..2232cdbe8071 --- /dev/null +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs @@ -0,0 +1,52 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Management.Automation; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker +{ + public class PSArgumentCompleterAttribute : ArgumentCompleterAttribute + { + internal string[] ResourceTypes; + + public PSArgumentCompleterAttribute(params string[] argumentList) : base(CreateScriptBlock(argumentList)) + { + ResourceTypes = argumentList; + } + + public static ScriptBlock CreateScriptBlock(string[] resourceTypes) + { + List outputResourceTypes = new List(); + foreach (string resourceType in resourceTypes) + { + if (resourceType.Contains(" ")) + { + outputResourceTypes.Add("\'\'" + resourceType + "\'\'"); + } + else + { + outputResourceTypes.Add(resourceType); + } + } + string scriptResourceTypeList = "'" + String.Join("' , '", outputResourceTypes) + "'"; + string script = "param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)\n" + + String.Format("$values = {0}\n", scriptResourceTypeList) + + "$values | Where-Object { $_ -Like \"$wordToComplete*\" -or $_ -Like \"'$wordToComplete*\" } | Sort-Object | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) }"; + ScriptBlock scriptBlock = ScriptBlock.Create(script); + return scriptBlock; + } + } +} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs index b818fb751a5d..606a51aacf29 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs @@ -20,11 +20,13 @@ public class ExportFormatPs1xml : PSCmdlet public string FilePath { get; set; } private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; private const string PropertiesExcludedForTableview = @"Id,Type"; private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + private static string SelectedBySuffix = @"#Multiple"; + protected override void ProcessRecord() { try @@ -76,7 +78,7 @@ private static View CreateViewModel(ViewParameters viewParameters) Name = viewParameters.Type.FullName, ViewSelectedBy = new ViewSelectedBy { - TypeName = viewParameters.Type.FullName + TypeName = string.Concat(viewParameters.Type.FullName, SelectedBySuffix) }, TableControl = new TableControl { diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs index e0ca4711ea39..a7f3e5861f6d 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs @@ -24,7 +24,7 @@ public class ExportModelSurface : PSCmdlet public bool UseExpandedFormat { get; set; } private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; protected override void ProcessRecord() { diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index 871f7c7e8870..5aeaeef2c58d 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs @@ -70,9 +70,8 @@ protected override void ProcessRecord() var variantGroups = profileGroups.SelectMany(pg => pg.Variants .GroupBy(v => new { v.CmdletName, v.IsInternal }) .Select(vg => new VariantGroup(ModuleName, vg.Key.CmdletName, vg.Select(v => v).ToArray(), - Path.Combine(vg.Key.IsInternal ? InternalFolder : ExportsFolder, pg.ProfileFolder), pg.ProfileName, isInternal: vg.Key.IsInternal))) + Path.Combine(vg.Key.IsInternal ? InternalFolder : ExportsFolder, pg.ProfileFolder), pg.ProfileName, isInternal: vg.Key.IsInternal))) .ToArray(); - var license = new StringBuilder(); license.Append(@" # ---------------------------------------------------------------------------------- @@ -114,6 +113,7 @@ protected override void ProcessRecord() sb.Append("param("); sb.Append($"{(parameterGroups.Any() ? Environment.NewLine : String.Empty)}"); + foreach (var parameterGroup in parameterGroups) { var parameters = parameterGroup.HasAllVariants ? parameterGroup.Parameters.Take(1) : parameterGroup.Parameters; diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs index 5b67d8b12167..98cbf9f8009f 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs @@ -137,7 +137,7 @@ protected override void ProcessRecord() } else { - var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().Append("*").ToPsList(); + var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().ToPsList(); sb.AppendLine($@"{Indent}FunctionsToExport = {cmdletsList}"); } @@ -148,8 +148,10 @@ protected override void ProcessRecord() } else { - var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().Append("*").ToPsList(); - sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}"); + var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().ToPsList(); + if (!String.IsNullOrEmpty(aliasesList)) { + sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}"); + } } // CmdletsToExport diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs index 8e57221c9684..ee765ae86f61 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -12,50 +12,96 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell { - [Cmdlet(VerbsData.Export, "TestStub")] - [DoNotExport] - public class ExportTestStub : PSCmdlet - { - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string ModuleName { get; set; } - - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string ExportsFolder { get; set; } - - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string OutputFolder { get; set; } - - [Parameter] - public SwitchParameter IncludeGenerated { get; set; } - - protected override void ProcessRecord() + [Cmdlet(VerbsData.Export, "TestStub")] + [DoNotExport] + public class ExportTestStub : PSCmdlet { - try - { - if (!Directory.Exists(ExportsFolder)) - { - throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); - } + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } - var exportDirectories = Directory.GetDirectories(ExportsFolder); - if (!exportDirectories.Any()) - { - exportDirectories = new[] { ExportsFolder }; - } - var utilFile = Path.Combine(OutputFolder, "utils.ps1"); - if (!File.Exists(utilFile)) + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public SwitchParameter IncludeGenerated { get; set; } + + protected override void ProcessRecord() { - var sc = new StringBuilder(); - sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + var exportDirectories = Directory.GetDirectories(ExportsFolder); + if (!exportDirectories.Any()) + { + exportDirectories = new[] { ExportsFolder }; + } + /*var loadEnvFile = Path.Combine(OutputFolder, "loadEnv.ps1"); + if (!File.Exists(loadEnvFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@" +$envFile = 'env.json' +if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' +} + +if (Test-Path -Path (Join-Path $PSScriptRoot $envFile)) { + $envFilePath = Join-Path $PSScriptRoot $envFile +} else { + $envFilePath = Join-Path $PSScriptRoot '..\$envFile' +} +$env = @{} +if (Test-Path -Path $envFilePath) { + $env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json +}"); + File.WriteAllText(loadEnvFile, sc.ToString()); + }*/ + var utilFile = Path.Combine(OutputFolder, "utils.ps1"); + if (!File.Exists(utilFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { if ($allChars) { return -join ((33..126) | Get-Random -Count $len | % {[char]$_}) } else { return -join ((48..57) + (97..122) | Get-Random -Count $len | % {[char]$_}) } } +function Start-TestSleep { + [CmdletBinding(DefaultParameterSetName = 'SleepBySeconds')] + param( + [parameter(Mandatory = $true, Position = 0, ParameterSetName = 'SleepBySeconds')] + [ValidateRange(0.0, 2147483.0)] + [double] $Seconds, + + [parameter(Mandatory = $true, ParameterSetName = 'SleepByMilliseconds')] + [ValidateRange('NonNegative')] + [Alias('ms')] + [int] $Milliseconds + ) + + if ($TestMode -ne 'playback') { + switch ($PSCmdlet.ParameterSetName) { + 'SleepBySeconds' { + Start-Sleep -Seconds $Seconds + } + 'SleepByMilliseconds' { + Start-Sleep -Milliseconds $Milliseconds + } + } + } +} + $env = @{} if ($UsePreviousConfigForRecord) { $previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json @@ -80,37 +126,40 @@ function cleanupEnv() { # Clean resources you create for testing } "); - File.WriteAllText(utilFile, sc.ToString()); - } - foreach (var exportDirectory in exportDirectories) - { - var outputFolder = OutputFolder; - if (exportDirectory != ExportsFolder) - { - outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); - Directory.CreateDirectory(outputFolder); - } - - var variantGroups = GetScriptCmdlets(exportDirectory) - .SelectMany(fi => fi.ToVariants()) - .Where(v => !v.IsDoNotExport) - .GroupBy(v => v.CmdletName) - .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) - .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); - - foreach (var variantGroup in variantGroups) - { - var sb = new StringBuilder(); - sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); - sb.AppendLine(@"{ + File.WriteAllText(utilFile, sc.ToString()); + } + + + + foreach (var exportDirectory in exportDirectories) + { + var outputFolder = OutputFolder; + if (exportDirectory != ExportsFolder) + { + outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); + Directory.CreateDirectory(outputFolder); + } + + var variantGroups = GetScriptCmdlets(exportDirectory) + .SelectMany(fi => fi.ToVariants()) + .Where(v => !v.IsDoNotExport) + .GroupBy(v => v.CmdletName) + .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) + .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); + + foreach (var variantGroup in variantGroups) + { + var sb = new StringBuilder(); + sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); + sb.AppendLine(@"{ $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' if (-Not (Test-Path -Path $loadEnvPath)) { $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' } . ($loadEnvPath)" -); - sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); - sb.AppendLine(@" $currentPath = $PSScriptRoot + ); + sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); + sb.AppendLine(@" $currentPath = $PSScriptRoot while(-not $mockingPath) { $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File $currentPath = Split-Path -Path $currentPath -Parent @@ -120,29 +169,29 @@ function cleanupEnv() { "); - sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); - var variants = variantGroup.Variants - .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) - .ToList(); + sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); + var variants = variantGroup.Variants + .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) + .ToList(); - foreach (var variant in variants) + foreach (var variant in variants) + { + sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); + sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); + var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; + sb.AppendLine($"{Indent}}}{variantSeparator}"); + } + sb.AppendLine("}"); + + File.WriteAllText(variantGroup.FilePath, sb.ToString()); + } + } + } + catch (Exception ee) { - sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); - sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); - var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; - sb.AppendLine($"{Indent}}}{variantSeparator}"); + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; } - sb.AppendLine("}"); - - File.WriteAllText(variantGroup.FilePath, sb.ToString()); - } } - } - catch (Exception ee) - { - Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); - throw ee; - } } - } } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs index 7a19a6af0299..baeb7fe870ab 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs @@ -94,7 +94,7 @@ public static void WriteMarkdowns(IEnumerable variantGroups, PsMod sb.Append($"## RELATED LINKS{Environment.NewLine}{Environment.NewLine}"); foreach (var relatedLink in markdownInfo.RelatedLinks) { - sb.Append($"{relatedLink}{Environment.NewLine}{Environment.NewLine}"); + sb.Append($"[{relatedLink}]({relatedLink}){Environment.NewLine}{Environment.NewLine}"); } File.WriteAllText(Path.Combine(docsFolder, $"{markdownInfo.CmdletName}.md"), sb.ToString()); diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs index 688bb65891a1..1086057cec65 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs @@ -31,7 +31,7 @@ internal class MarkdownHelpInfo public string[] Inputs { get; } public string[] Outputs { get; } public ComplexInterfaceInfo[] ComplexInterfaceInfos { get; } - public string[] RelatedLinks { get; } + public MarkdownRelatedLinkInfo[] RelatedLinks { get; } public bool SupportsShouldProcess { get; } public bool SupportsPaging { get; } @@ -67,7 +67,11 @@ public MarkdownHelpInfo(VariantGroup variantGroup, string examplesFolder, string ComplexInterfaceInfos = variantGroup.ComplexInterfaceInfos; OnlineVersion = commentInfo.OnlineVersion; - RelatedLinks = commentInfo.RelatedLinks; + + var relatedLinkLists = new List(); + relatedLinkLists.AddRange(commentInfo.RelatedLinks?.Select(link => new MarkdownRelatedLinkInfo(link))); + relatedLinkLists.AddRange(variantGroup.Variants.SelectMany(v => v.Attributes).OfType()?.Distinct()?.Select(link => new MarkdownRelatedLinkInfo(link.Url, link.Description))); + RelatedLinks = relatedLinkLists?.ToArray(); SupportsShouldProcess = variantGroup.SupportsShouldProcess; SupportsPaging = variantGroup.SupportsPaging; @@ -218,14 +222,45 @@ public MarkdownParameterHelpInfo(PsParameterHelpInfo[] parameterHelpInfos, Param } } + internal class MarkdownRelatedLinkInfo + { + public string Url { get; } + public string Description { get; } + + public MarkdownRelatedLinkInfo(string url) + { + Url = url; + } + + public MarkdownRelatedLinkInfo(string url, string description) + { + Url = url; + Description = description; + } + + public override string ToString() + { + if (string.IsNullOrEmpty(Description)) + { + return Url; + } + else + { + return $@"[{Description}]({Url})"; + + } + + } + } + internal static class MarkdownTypesExtensions { public static MarkdownExampleHelpInfo ToExampleHelpInfo(this PsHelpExampleInfo exampleInfo) => new MarkdownExampleHelpInfo(exampleInfo.Title, exampleInfo.Code, exampleInfo.Output, exampleInfo.Remarks); public static MarkdownExampleHelpInfo[] DefaultExampleHelpInfos = { - new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"), - new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"), + new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here (remove the output block if the example doesn't have an output) }}}}", @"{{ Add description here }}"), + new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here (remove the output block if the example doesn't have an output) }}}}", @"{{ Add description here }}"), }; public static MarkdownParameterHelpInfo[] SupportsShouldProcessParameters = diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index a2ec6938d544..dc569d652819 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -121,6 +121,21 @@ public override string ToString() => CompleterInfo != null : String.Empty; } + internal class PSArgumentCompleterOutput : ArgumentCompleterOutput + { + public PSArgumentCompleterInfo PSArgumentCompleterInfo { get; } + + public PSArgumentCompleterOutput(PSArgumentCompleterInfo completerInfo) : base(completerInfo) + { + PSArgumentCompleterInfo = completerInfo; + } + + + public override string ToString() => PSArgumentCompleterInfo != null + ? $"{Indent}[{typeof(PSArgumentCompleterAttribute)}({(PSArgumentCompleterInfo.IsTypeCompleter ? $"[{PSArgumentCompleterInfo.Type.Unwrap().ToPsType()}]" : $"{PSArgumentCompleterInfo.ResourceTypes?.Select(r => $"\"{r}\"")?.JoinIgnoreEmpty(", ")}")})]{Environment.NewLine}" + : String.Empty; + } + internal class DefaultInfoOutput { public bool HasDefaultInfo { get; } @@ -173,6 +188,7 @@ internal class BaseOutput public VariantGroup VariantGroup { get; } protected static readonly bool IsAzure = Convert.ToBoolean(@"true"); + public BaseOutput(VariantGroup variantGroup) { VariantGroup = variantGroup; @@ -200,6 +216,21 @@ public string GetProcessCustomAttributesAtRuntime() {Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; } + private string GetLoginVerification() + { + if (!VariantGroup.IsInternal && IsAzure && !VariantGroup.IsModelCmdlet) + { + return $@" +{Indent}{Indent}$context = Get-AzContext +{Indent}{Indent}if (-not $context -and -not $testPlayback) {{ +{Indent}{Indent}{Indent}Write-Error ""No Azure login detected. Please run 'Connect-AzAccount' to log in."" +{Indent}{Indent}{Indent}exit +{Indent}{Indent}}} +"; + } + return ""; + } + private string GetTelemetry() { if (!VariantGroup.IsInternal && IsAzure) @@ -232,10 +263,16 @@ public override string ToString() => $@"begin {{ {Indent}{Indent}{Indent}$PSBoundParameters['OutBuffer'] = 1 {Indent}{Indent}}} {Indent}{Indent}$parameterSet = $PSCmdlet.ParameterSetName -{GetTelemetry()} +{Indent}{Indent} +{Indent}{Indent}$testPlayback = $false +{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }} +{GetLoginVerification()}{GetTelemetry()} {GetParameterSetToCmdletMapping()}{GetDefaultValuesStatements()} {GetProcessCustomAttributesAtRuntime()} {Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) +{Indent}{Indent}if ($wrappedCmd -eq $null) {{ +{Indent}{Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) +{Indent}{Indent}}} {Indent}{Indent}$scriptCmd = {{& $wrappedCmd @PSBoundParameters}} {Indent}{Indent}$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) {Indent}{Indent}$steppablePipeline.Begin($PSCmdlet) @@ -269,13 +306,16 @@ private string GetDefaultValuesStatements() var variantListString = defaultInfo.ParameterGroup.VariantNames.ToPsList(); var parameterName = defaultInfo.ParameterGroup.ParameterName; sb.AppendLine(); + var setCondition = " "; + if (!String.IsNullOrEmpty(defaultInfo.SetCondition)) + { + setCondition = $" -and {defaultInfo.SetCondition}"; + } //Yabo: this is bad to hard code the subscription id, but autorest load input README.md reversely (entry readme -> required readme), there are no other way to //override default value set in required readme if ("SubscriptionId".Equals(parameterName)) { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); - sb.AppendLine($"{Indent}{Indent}{Indent}$testPlayback = $false"); - sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }}"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}if ($testPlayback) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')"); sb.AppendLine($"{Indent}{Indent}{Indent}}} else {{"); @@ -285,13 +325,15 @@ private string GetDefaultValuesStatements() } else { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); sb.Append($"{Indent}{Indent}}}"); } + } return sb.ToString(); } + } internal class ProcessOutput : BaseOutput @@ -381,6 +423,8 @@ public override string ToString() var notesText = !String.IsNullOrEmpty(notes) ? $"{Environment.NewLine}.Notes{Environment.NewLine}{ComplexParameterHeader}{notes}" : String.Empty; var relatedLinks = String.Join(Environment.NewLine, CommentInfo.RelatedLinks.Select(l => $".Link{Environment.NewLine}{l}")); var relatedLinksText = !String.IsNullOrEmpty(relatedLinks) ? $"{Environment.NewLine}{relatedLinks}" : String.Empty; + var externalUrls = String.Join(Environment.NewLine, CommentInfo.ExternalUrls.Select(l => $".Link{Environment.NewLine}{l}")); + var externalUrlsText = !String.IsNullOrEmpty(externalUrls) ? $"{Environment.NewLine}{externalUrls}" : String.Empty; var examples = ""; foreach (var example in VariantGroup.HelpInfo.Examples) { @@ -393,7 +437,7 @@ public override string ToString() {CommentInfo.Description.ToDescriptionFormat(false)} {examples}{inputsText}{outputsText}{notesText} .Link -{CommentInfo.OnlineVersion}{relatedLinksText} +{CommentInfo.OnlineVersion}{relatedLinksText}{externalUrlsText} #> "; } @@ -587,7 +631,9 @@ public static string ToSyntaxTypeName(this Type type) public static AllowEmptyArrayOutput ToAllowEmptyArray(this bool hasAllowEmptyArray) => new AllowEmptyArrayOutput(hasAllowEmptyArray); - public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => new ArgumentCompleterOutput(completerInfo); + public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => (completerInfo is PSArgumentCompleterInfo psArgumentCompleterInfo) ? psArgumentCompleterInfo.ToArgumentCompleterOutput() : new ArgumentCompleterOutput(completerInfo); + + public static PSArgumentCompleterOutput ToArgumentCompleterOutput(this PSArgumentCompleterInfo completerInfo) => new PSArgumentCompleterOutput(completerInfo); public static DefaultInfoOutput ToDefaultInfoOutput(this ParameterGroup parameterGroup) => new DefaultInfoOutput(parameterGroup); diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs index 14a6b75f8870..00a3a954772e 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs @@ -31,7 +31,7 @@ internal class VariantGroup { public string ModuleName { get; } - public string RootModuleName {get => @"";} + public string RootModuleName { get => @""; } public string CmdletName { get; } public string CmdletVerb { get; } public string CmdletNoun { get; } @@ -49,7 +49,7 @@ internal class VariantGroup public PsHelpInfo HelpInfo { get; } public bool IsGenerated { get; } public bool IsInternal { get; } - + public bool IsModelCmdlet { get; } public string OutputFolder { get; } public string FileName { get; } public string FilePath { get; } @@ -84,7 +84,7 @@ public VariantGroup(string moduleName, string cmdletName, Variant[] variants, st HelpInfo = Variants.Select(v => v.HelpInfo).FirstOrDefault() ?? new PsHelpInfo(); IsGenerated = Variants.All(v => v.Attributes.OfType().Any()); IsInternal = isInternal; - + IsModelCmdlet = Variants.All(v => v.IsModelCmdlet); OutputFolder = outputFolder; FileName = $"{CmdletName}{(isTest ? ".Tests" : String.Empty)}.ps1"; FilePath = Path.Combine(OutputFolder, FileName); @@ -101,12 +101,23 @@ private string DetermineDefaultParameterSetName() if (String.IsNullOrEmpty(defaultParameterSet)) { var variantParamCountGroups = Variants + .Where(v => !v.IsNotSuggestDefaultParameterSet) .Select(v => ( variant: v.VariantName, paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) .GroupBy(vpc => vpc.isSimple) .ToArray(); + if (variantParamCountGroups.Length == 0) + { + variantParamCountGroups = Variants + .Select(v => ( + variant: v.VariantName, + paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), + isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) + .GroupBy(vpc => vpc.isSimple) + .ToArray(); + } var variantParameterCounts = (variantParamCountGroups.Any(g => g.Key) ? variantParamCountGroups.Where(g => g.Key) : variantParamCountGroups).SelectMany(g => g).ToArray(); var smallestParameterCount = variantParameterCounts.Min(vpc => vpc.paramCount); defaultParameterSet = variantParameterCounts.First(vpc => vpc.paramCount == smallestParameterCount).variant; @@ -134,7 +145,9 @@ internal class Variant public Parameter[] Parameters { get; } public Parameter[] CmdletOnlyParameters { get; } public bool IsInternal { get; } + public bool IsModelCmdlet { get; } public bool IsDoNotExport { get; } + public bool IsNotSuggestDefaultParameterSet { get; } public string[] Profiles { get; } public Variant(string cmdletName, string variantName, CommandInfo info, CommandMetadata metadata, bool hasParameterSets = false, PsHelpInfo helpInfo = null) @@ -155,6 +168,8 @@ public Variant(string cmdletName, string variantName, CommandInfo info, CommandM Parameters = this.ToParameters().OrderBy(p => p.OrderCategory).ThenByDescending(p => p.IsMandatory).ToArray(); IsInternal = Attributes.OfType().Any(); IsDoNotExport = Attributes.OfType().Any(); + IsModelCmdlet = Attributes.OfType().Any(); + IsNotSuggestDefaultParameterSet = Attributes.OfType().Any(); CmdletOnlyParameters = Parameters.Where(p => !p.Categories.Any(c => c == ParameterCategory.Azure || c == ParameterCategory.Runtime)).ToArray(); Profiles = Attributes.OfType().SelectMany(pa => pa.Profiles).ToArray(); } @@ -210,6 +225,7 @@ public ParameterGroup(string parameterName, Parameter[] parameters, string[] all HasValidateNotNull = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); HasAllowEmptyArray = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); CompleterInfo = Parameters.Select(p => p.CompleterInfoAttribute).FirstOrDefault()?.ToCompleterInfo() + ?? Parameters.Select(p => p.PSArgumentCompleterAttribute).FirstOrDefault()?.ToPSArgumentCompleterInfo() ?? Parameters.Select(p => p.ArgumentCompleterAttribute).FirstOrDefault()?.ToCompleterInfo(); DefaultInfo = Parameters.Select(p => p.DefaultInfoAttribute).FirstOrDefault()?.ToDefaultInfo(this) ?? Parameters.Select(p => p.DefaultValueAttribute).FirstOrDefault(dv => dv != null)?.ToDefaultInfo(this); @@ -244,7 +260,6 @@ internal class Parameter public ParameterMetadata Metadata { get; } public PsParameterHelpInfo HelpInfo { get; } public Type ParameterType { get; } - public Attribute[] Attributes { get; } public ParameterCategory[] Categories { get; } public ParameterCategory OrderCategory { get; } @@ -254,6 +269,7 @@ internal class Parameter public bool SupportsWildcards { get; } public CompleterInfoAttribute CompleterInfoAttribute { get; } public ArgumentCompleterAttribute ArgumentCompleterAttribute { get; } + public PSArgumentCompleterAttribute PSArgumentCompleterAttribute { get; } public bool ValueFromPipeline { get; } public bool ValueFromPipelineByPropertyName { get; } @@ -286,7 +302,8 @@ public Parameter(string variantName, string parameterName, ParameterMetadata met } SupportsWildcards = Attributes.OfType().Any(); CompleterInfoAttribute = Attributes.OfType().FirstOrDefault(); - ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + PSArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(attr => !attr.GetType().Equals(typeof(PSArgumentCompleterAttribute))); ValueFromPipeline = ParameterAttribute.ValueFromPipeline; ValueFromPipelineByPropertyName = ParameterAttribute.ValueFromPipelineByPropertyName; @@ -295,10 +312,10 @@ public Parameter(string variantName, string parameterName, ParameterMetadata met IsMandatory = ParameterAttribute.Mandatory; var complexParameterName = ParameterName.ToUpperInvariant(); - var complexMessage = $"{Environment.NewLine}To construct, see NOTES section for {complexParameterName} properties and create a hash table."; + var complexMessage = $"{Environment.NewLine}"; var description = ParameterAttribute.HelpMessage.NullIfEmpty() ?? HelpInfo.Description.NullIfEmpty() ?? InfoAttribute?.Description.NullIfEmpty() ?? String.Empty; // Remove the complex type message as it will be reinserted if this is a complex type - description = description.NormalizeNewLines().Replace(complexMessage, String.Empty).Replace(complexMessage.ToPsSingleLine(), String.Empty); + description = description.NormalizeNewLines(); // Make an InfoAttribute for processing only if one isn't provided InfoAttribute = Attributes.OfType().FirstOrDefault() ?? new InfoAttribute { PossibleTypes = new[] { ParameterType.Unwrap() }, Required = IsMandatory }; // Set the description if the InfoAttribute does not have one since they are exported without a description @@ -318,7 +335,7 @@ internal class ComplexInterfaceInfo public bool Required { get; } public bool ReadOnly { get; } public string Description { get; } - + public ComplexInterfaceInfo[] NestedInfos { get; } public bool IsComplexInterface { get; } @@ -335,7 +352,7 @@ public ComplexInterfaceInfo(string name, Type type, InfoAttribute infoAttribute, var unwrappedType = Type.Unwrap(); var hasBeenSeen = seenTypes?.Contains(unwrappedType) ?? false; (seenTypes ?? (seenTypes = new List())).Add(unwrappedType); - NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[]{} : + NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[] { } : unwrappedType.GetInterfaces() .Concat(InfoAttribute.PossibleTypes) .SelectMany(pt => pt.GetProperties() @@ -366,6 +383,7 @@ internal class CommentInfo public string OnlineVersion { get; } public string[] RelatedLinks { get; } + public string[] ExternalUrls { get; } private const string HelpLinkPrefix = @"https://learn.microsoft.com/powershell/module/"; @@ -391,6 +409,9 @@ public CommentInfo(VariantGroup variantGroup) var moduleName = variantGroup.RootModuleName == "" ? variantGroup.ModuleName.ToLowerInvariant() : variantGroup.RootModuleName.ToLowerInvariant(); OnlineVersion = helpInfo.OnlineVersion?.Uri.NullIfEmpty() ?? $@"{HelpLinkPrefix}{moduleName}/{variantGroup.CmdletName.ToLowerInvariant()}"; RelatedLinks = helpInfo.RelatedLinks.Select(rl => rl.Text).ToArray(); + + // Get external urls from attribute + ExternalUrls = variantGroup.Variants.SelectMany(v => v.Attributes).OfType()?.Select(e => e.Url)?.Distinct()?.ToArray(); } } @@ -420,11 +441,22 @@ public CompleterInfo(ArgumentCompleterAttribute completerAttribute) } } + internal class PSArgumentCompleterInfo : CompleterInfo + { + public string[] ResourceTypes { get; } + + public PSArgumentCompleterInfo(PSArgumentCompleterAttribute completerAttribute) : base(completerAttribute) + { + ResourceTypes = completerAttribute.ResourceTypes; + } + } + internal class DefaultInfo { public string Name { get; } public string Description { get; } public string Script { get; } + public string SetCondition { get; } public ParameterGroup ParameterGroup { get; } public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) @@ -432,6 +464,7 @@ public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterG Name = infoAttribute.Name; Description = infoAttribute.Description; Script = infoAttribute.Script; + SetCondition = infoAttribute.SetCondition; ParameterGroup = parameterGroup; } @@ -479,7 +512,8 @@ public static Parameter[] ToParameters(this Variant variant) parameterHelp = parameterHelp.Where(ph => (!ph.ParameterSetNames.Any() || ph.ParameterSetNames.Any(psn => psn == variant.VariantName || psn == AllParameterSets)) && ph.Name != "IncludeTotalCount"); } var result = parameters.Select(p => new Parameter(variant.VariantName, p.Key, p.Value, parameterHelp.FirstOrDefault(ph => ph.Name == p.Key))); - if (variant.SupportsPaging) { + if (variant.SupportsPaging) + { // If supportsPaging is set, we will need to add First and Skip parameters since they are treated as common parameters which as not contained on Metadata>parameters variant.Info.Parameters["First"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Gets only the first 'n' objects."; variant.Info.Parameters["Skip"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Ignores the first 'n' objects and then gets the remaining objects."; @@ -507,7 +541,7 @@ public static ComplexInterfaceInfo ToComplexInterfaceInfo(this InfoAttribute inf public static CompleterInfo ToCompleterInfo(this CompleterInfoAttribute infoAttribute) => new CompleterInfo(infoAttribute); public static CompleterInfo ToCompleterInfo(this ArgumentCompleterAttribute completerAttribute) => new CompleterInfo(completerAttribute); - + public static PSArgumentCompleterInfo ToPSArgumentCompleterInfo(this PSArgumentCompleterAttribute completerAttribute) => new PSArgumentCompleterInfo(completerAttribute); public static DefaultInfo ToDefaultInfo(this DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) => new DefaultInfo(infoAttribute, parameterGroup); public static DefaultInfo ToDefaultInfo(this PSDefaultValueAttribute defaultValueAttribute, ParameterGroup parameterGroup) => new DefaultInfo(defaultValueAttribute, parameterGroup); } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/PsAttributes.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/PsAttributes.cs index 543269ecc81a..bff7db3366d7 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/PsAttributes.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/PsAttributes.cs @@ -22,6 +22,11 @@ public class DoNotExportAttribute : Attribute { } + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] + public class ModelCmdletAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Class)] public class InternalExportAttribute : Attribute { @@ -55,6 +60,11 @@ public class HttpPathAttribute : Attribute public string ApiVersion { get; set; } } + [AttributeUsage(AttributeTargets.Class)] + public class NotSuggestDefaultParameterSetAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] public class CategoryAttribute : Attribute { @@ -109,6 +119,11 @@ public enum PropertyOrigin Inlined } + [AttributeUsage(AttributeTargets.Property)] + public class ConstantAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Property)] public class FormatTableAttribute : Attribute { diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/PsExtensions.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/PsExtensions.cs index 86c8f6c5b90c..515e0737207d 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/PsExtensions.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/PsExtensions.cs @@ -13,6 +13,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PowerShell { internal static class PsExtensions { + public static PSObject AddMultipleTypeNameIntoPSObject(this object obj, string multipleTag = "#Multiple") + { + var psObj = new PSObject(obj); + psObj.TypeNames.Insert(0, $"{psObj.TypeNames[0]}{multipleTag}"); + return psObj; + } + // https://stackoverflow.com/a/863944/294804 // https://stackoverflow.com/a/4452598/294804 // https://stackoverflow.com/a/28701974/294804 diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/PsHelpers.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/PsHelpers.cs index d7eba5cb0d0d..07fd77c66957 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/PsHelpers.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/BuildTime/PsHelpers.cs @@ -67,7 +67,7 @@ public static IEnumerable GetScriptHelpInfo(params string[] modulePath public static IEnumerable GetModuleCmdletsAndHelpInfo(PSCmdlet cmdlet, params string[] modulePaths) { - var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp => + var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp => $@"(Get-Command -Module (Import-Module '{mp}' -PassThru) | Where-Object {{ $_.CommandType -ne 'Alias' }} | ForEach-Object {{ @{{ CommandInfo = $_; HelpInfo = ( invoke-command {{ try {{ Get-Help -Name $_.Name -Full }} catch{{ '' }} }} ) }} }})" )); return (cmdlet?.RunScript(getCmdletAndHelp) ?? RunScript(getCmdletAndHelp)) @@ -88,7 +88,7 @@ public static Guid ReadGuidFromPsd1(string psd1Path) if (File.Exists(psd1Path)) { var currentGuid = File.ReadAllLines(psd1Path) - .FirstOrDefault(l => l.StartsWith(GuidStart))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) + .FirstOrDefault(l => l.TrimStart().StartsWith(GuidStart.TrimStart()))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) .LastOrDefault()?.Replace("'", String.Empty); guid = currentGuid != null ? Guid.Parse(currentGuid) : guid; } diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/Context.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/Context.cs new file mode 100644 index 000000000000..6b5663f9b757 --- /dev/null +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/Context.cs @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.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.ServiceLinker.Runtime.Extensions; + + /// + /// The IContext Interface defines the communication mechanism for input customization. + /// + /// + /// In the context, we will have client, pipeline, PSBoundParamters, default EventListener, Cancellation. + /// + public interface IContext + { + System.Management.Automation.InvocationInfo InvocationInformation { get; set; } + System.Threading.CancellationTokenSource CancellationTokenSource { get; set; } + System.Collections.Generic.IDictionary ExtensibleParameters { get; } + HttpPipeline Pipeline { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.ServiceLinker Client { get; } + } +} diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/Events.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/Events.cs index fb0a002eb224..02830bfc329f 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/Events.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/Events.cs @@ -22,6 +22,6 @@ public static partial class Events public const string FollowingNextLink = nameof(FollowingNextLink); public const string DelayBeforePolling = nameof(DelayBeforePolling); public const string Polling = nameof(Polling); - + public const string Progress = nameof(Progress); } -} \ No newline at end of file +} diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/ISendAsync.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/ISendAsync.cs index d6b451aa43cf..6ab6776e212e 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/ISendAsync.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/ISendAsync.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime using System.Threading.Tasks; using System.Collections; using System.Linq; + using System; + /// /// The interface for sending an HTTP request across the wire. @@ -70,6 +72,7 @@ public interface ISendAsyncTerminalFactory public partial class HttpPipeline : ISendAsync { + private const int DefaultMaxRetry = 3; private ISendAsync pipeline; private ISendAsyncTerminalFactory terminal; private List steps = new List(); @@ -92,6 +95,111 @@ public HttpPipeline(ISendAsyncTerminalFactory terminalStep) /// public HttpPipeline Clone() => new HttpPipeline(terminal) { steps = this.steps.ToList(), pipeline = this.pipeline }; + private bool shouldRetry429(HttpResponseMessage response) + { + if (response.StatusCode == (System.Net.HttpStatusCode)429) + { + var retryAfter = response.Headers.RetryAfter; + if (retryAfter != null && retryAfter.Delta.HasValue) + { + return true; + } + } + return false; + } + /// + /// The step to handle 429 response with retry-after header. + /// + public async Task Retry429(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + int retryCount = int.MaxValue; + + try + { + try + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("PS_HTTP_MAX_RETRIES_FOR_429")); + } + finally + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("AZURE_PS_HTTP_MAX_RETRIES_FOR_429")); + } + } + catch (System.Exception) + { + //no action + } + var cloneRequest = await request.CloneWithContent(); + var response = await next.SendAsync(request, callback); + int count = 0; + while (shouldRetry429(response) && count++ < retryCount) + { + request = await cloneRequest.CloneWithContent(); + var retryAfter = response.Headers.RetryAfter; + await Task.Delay(retryAfter.Delta.Value, callback.Token); + await callback.Signal("Debug", $"Start to retry {count} time(s) on status code 429 after waiting {retryAfter.Delta.Value.TotalSeconds} seconds."); + response = await next.SendAsync(request, callback); + } + return response; + } + + private bool shouldRetryError(HttpResponseMessage response) + { + if (response.StatusCode >= System.Net.HttpStatusCode.InternalServerError) + { + if (response.StatusCode != System.Net.HttpStatusCode.NotImplemented && + response.StatusCode != System.Net.HttpStatusCode.HttpVersionNotSupported) + { + return true; + } + } + else if (response.StatusCode == System.Net.HttpStatusCode.RequestTimeout) + { + return true; + } + else if (response.StatusCode == (System.Net.HttpStatusCode)429 && response.Headers.RetryAfter == null) + { + return true; + } + return false; + } + + /// + /// Returns true if status code in HttpRequestExceptionWithStatus exception is greater + /// than or equal to 500 and not NotImplemented (501) or HttpVersionNotSupported (505). + /// Or it's 429 (TOO MANY REQUESTS) without Retry-After header. + /// + public async Task RetryError(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + int retryCount = DefaultMaxRetry; + + try + { + try + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("PS_HTTP_MAX_RETRIES")); + } + finally + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("AZURE_PS_HTTP_MAX_RETRIES")); + } + } + catch (System.Exception) + { + //no action + } + var cloneRequest = await request.CloneWithContent(); + var response = await next.SendAsync(request, callback); + int count = 0; + while (shouldRetryError(response) && count++ < retryCount) + { + await callback.Signal("Debug", $"Start to retry {count} time(s) on status code {response.StatusCode}"); + request = await cloneRequest.CloneWithContent(); + response = await next.SendAsync(request, callback); + } + return response; + } + public ISendAsyncTerminalFactory TerminalFactory { get => terminal; @@ -117,6 +225,11 @@ public ISendAsync Pipeline // create the pipeline from scratch. var next = terminal.Create(); + if (Convert.ToBoolean(@"true")) + { + next = (new SendAsyncFactory(Retry429)).Create(next) ?? next; + next = (new SendAsyncFactory(RetryError)).Create(next) ?? next; + } foreach (var factory in steps) { // skip factories that return null. diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/InfoAttribute.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/InfoAttribute.cs index 43e44c329400..1bfd9c7c4b45 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/InfoAttribute.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/InfoAttribute.cs @@ -11,6 +11,9 @@ public class InfoAttribute : Attribute { public bool Required { get; set; } = false; public bool ReadOnly { get; set; } = false; + public bool Read { get; set; } = true; + public bool Create { get; set; } = true; + public bool Update { get; set; } = true; public Type[] PossibleTypes { get; set; } = new Type[0]; public string Description { get; set; } = ""; public string SerializedName { get; set; } = ""; @@ -30,5 +33,6 @@ public class DefaultInfoAttribute : Attribute public string Script { get; set; } = ""; public string Name { get; set; } = ""; public string Description { get; set; } = ""; + public string SetCondition { get; set; } = ""; } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/InputHandler.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/InputHandler.cs new file mode 100644 index 000000000000..b28a86c4f7fc --- /dev/null +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/InputHandler.cs @@ -0,0 +1,22 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +using System; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Cmdlets +{ + public abstract class InputHandler + { + protected InputHandler NextHandler = null; + + public void SetNextHandler(InputHandler nextHandler) + { + this.NextHandler = nextHandler; + } + + public abstract void Process(Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.IContext context); + } +} \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs index d3d46242a40c..4d4ecc94b810 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs @@ -21,6 +21,11 @@ internal XNodeArray(params JsonNode[] values) items = new List(values); } + internal XNodeArray(System.Collections.Generic.List values) + { + items = new List(values); + } + public override JsonNode this[int index] => items[index]; internal override JsonType? ElementType => null; diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/SerializationMode.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/SerializationMode.cs index d329ca49dd05..5092b4e92f43 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/SerializationMode.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/SerializationMode.cs @@ -9,8 +9,10 @@ public enum SerializationMode { None = 0, IncludeHeaders = 1 << 0, - IncludeReadOnly = 1 << 1, - - IncludeAll = IncludeHeaders | IncludeReadOnly + IncludeRead = 1 << 1, + IncludeCreate = 1 << 2, + IncludeUpdate = 1 << 3, + IncludeAll = IncludeHeaders | IncludeRead | IncludeCreate | IncludeUpdate, + IncludeCreateOrUpdate = IncludeCreate | IncludeUpdate } } \ No newline at end of file diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/TypeConverterExtensions.cs b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/TypeConverterExtensions.cs index 9651246a4c78..b6c1c3f04143 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/TypeConverterExtensions.cs +++ b/generated/ServiceLinker/ServiceLinker.Autorest/generated/runtime/TypeConverterExtensions.cs @@ -62,6 +62,56 @@ internal static T[] SelectToArray(object source, System.Func return result.ToArray(); } + internal static System.Collections.Generic.List SelectToList(object source, System.Func converter) + { + // null begets null + if (source == null) + { + return null; + } + + // single values and strings are just encapsulated in the array. + if (source is string || !(source is System.Collections.IEnumerable)) + { + try + { + return new T[] { (T)converter(source) }.ToList(); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + return new T[0].ToList(); // empty result if couldn't convert. + } + + var result = new System.Collections.Generic.List(); + foreach (var each in (System.Collections.IEnumerable)source) + { + try + { + result.Add((T)converter(each)); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + } + return result; + } internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Collections.Generic.IDictionary dictionary) { if (null != dictionary) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/internal/Get-AzServiceLinker.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/internal/Get-AzServiceLinker.ps1 index 3fab3638a921..2cb610c3cc97 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/internal/Get-AzServiceLinker.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/internal/Get-AzServiceLinker.ps1 @@ -27,7 +27,7 @@ Returns Linker resource for a given name. .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource .Notes COMPLEX PARAMETER PROPERTIES @@ -46,7 +46,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.servicelinker/get-azservicelinker #> function Get-AzServiceLinker { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -67,7 +67,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -126,6 +125,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Get = 'Az.ServiceLinker.private\Get-AzServiceLinker_Get'; @@ -134,6 +136,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/internal/Get-AzServiceLinkerConfiguration.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/internal/Get-AzServiceLinkerConfiguration.ps1 index dc4e8ff7feb8..4b4605f80abb 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/internal/Get-AzServiceLinkerConfiguration.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/internal/Get-AzServiceLinkerConfiguration.ps1 @@ -25,12 +25,12 @@ list source configurations for a Linker. {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult .Link https://learn.microsoft.com/powershell/module/az.servicelinker/get-azservicelinkerconfiguration #> function Get-AzServiceLinkerConfiguration { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -101,12 +101,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.ServiceLinker.private\Get-AzServiceLinkerConfiguration_List'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/internal/Get-AzServiceLinkerDryrun.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/internal/Get-AzServiceLinkerDryrun.ps1 index 28d2eb9b34f4..ca75aa5c462e 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/internal/Get-AzServiceLinkerDryrun.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/internal/Get-AzServiceLinkerDryrun.ps1 @@ -27,7 +27,7 @@ get a dryrun job .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource .Notes COMPLEX PARAMETER PROPERTIES @@ -46,7 +46,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.servicelinker/get-azservicelinkerdryrun #> function Get-AzServiceLinkerDryrun { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -66,7 +66,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -125,6 +124,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Get = 'Az.ServiceLinker.private\Get-AzServiceLinkerDryrun_Get'; @@ -133,6 +135,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/internal/Get-AzServiceLinkerOperation.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/internal/Get-AzServiceLinkerOperation.ps1 index 6bce8e07ffd0..55196dfab230 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/internal/Get-AzServiceLinkerOperation.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/internal/Get-AzServiceLinkerOperation.ps1 @@ -25,12 +25,12 @@ Lists the available ServiceLinker REST API operations. {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperation +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperation .Link https://learn.microsoft.com/powershell/module/az.servicelinker/get-azservicelinkeroperation #> function Get-AzServiceLinkerOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperation])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -89,12 +89,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.ServiceLinker.private\Get-AzServiceLinkerOperation_List'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/internal/New-AzServiceLinker.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/internal/New-AzServiceLinker.ps1 index 7fef46713a13..b1123f93dad3 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/internal/New-AzServiceLinker.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/internal/New-AzServiceLinker.ps1 @@ -16,40 +16,46 @@ <# .Synopsis -Create or update Linker resource. +create Linker resource. .Description -Create or update Linker resource. +create Linker resource. .Example {{ Add code here }} .Example {{ Add code here }} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource .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. AUTHINFO : The authentication type. - AuthType : The authentication type. + AuthType : The authentication type. + +INPUTOBJECT : Identity Parameter + [ConnectorName ]: The name of resource. + [DryrunName ]: The name of dryrun. + [Id ]: Resource identity path + [LinkerName ]: The name Linker resource. + [Location ]: The name of Azure region. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. + [SubscriptionId ]: The ID of the target subscription. TARGETSERVICE : The target service properties - Type : The target service type. + Type : The target service type. .Link https://learn.microsoft.com/powershell/module/az.servicelinker/new-azservicelinker #> function New-AzServiceLinker { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] - [System.String] - # The fully qualified Azure Resource manager identifier of the resource to be connected. - ${ResourceUri}, - - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Alias('LinkerName')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo(Script='"connect_"+(-join ((65..90) + (97..122) | Get-Random -Count 5 | % {[char]$_}))')] @@ -57,6 +63,18 @@ param( # The name Linker resource. ${Name}, + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] + [System.String] + # The fully qualified Azure Resource manager identifier of the resource to be connected. + ${ResourceUri}, + + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity] + # Identity Parameter + ${InputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Header')] [System.String] @@ -65,23 +83,22 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase] # The authentication type. - # To construct, see NOTES section for AUTHINFO properties and create a hash table. ${AuthInfo}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo(Script='"none"')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType] + [System.String] # The application client type ${ClientType}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType] + [System.String] # Optional, indicate whether to apply configurations on source application. # If enable, generate configurations and applied to the source application. # Default is enable. @@ -90,7 +107,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations]))] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations]))] [System.Collections.Hashtable] # A dictionary of additional configurations to be added. # Service will auto generate a set of basic configurations and this property is to full fill more customized configurations @@ -98,7 +115,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys]))] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys]))] [System.Collections.Hashtable] # Optional. # A dictionary of default key name and customized key name mapping. @@ -106,16 +123,16 @@ param( ${ConfigurationInfoCustomizedKey}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType] + [System.String] # Allow Azure services to access the target service if true. ${FirewallRuleAzureService}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType] + [System.String] # Allow caller client IP to access the target service if true. # the property is used when connecting local application to target service. ${FirewallRuleCallerClientIP}, @@ -128,9 +145,9 @@ param( ${FirewallRuleIPRange}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType] + [System.String] # Optional. # Indicates public network solution. # If enable, enable public network access of target service with best try. @@ -158,15 +175,14 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase] # The target service properties - # To construct, see NOTES section for TARGETSERVICE properties and create a hash table. ${TargetService}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType] + [System.String] # Type of VNet solution. ${VNetSolutionType}, @@ -238,18 +254,25 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ CreateExpanded = 'Az.ServiceLinker.private\New-AzServiceLinker_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.ServiceLinker.private\New-AzServiceLinker_CreateViaIdentityExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Name')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Name') ) { $PSBoundParameters['Name'] = "connect_"+(-join ((65..90) + (97..122) | Get-Random -Count 5 | % {[char]$_})) } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('ClientType')) { + if (('CreateExpanded', 'CreateViaIdentityExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('ClientType') ) { $PSBoundParameters['ClientType'] = "none" } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/internal/New-AzServiceLinkerConfiguration.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/internal/New-AzServiceLinkerConfiguration.ps1 index 6d15781c9d01..8668dbab2b1b 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/internal/New-AzServiceLinkerConfiguration.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/internal/New-AzServiceLinkerConfiguration.ps1 @@ -25,11 +25,11 @@ Generate configurations for a Linker. {{ Add code here }} .Inputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult .Notes COMPLEX PARAMETER PROPERTIES @@ -46,21 +46,23 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. PARAMETER : The configuration information, used to generate configurations or save to applications - [Action ]: Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied to the source application. Default is enable. If optOut, no configuration change will be made on source. + [Action ]: Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied to the source application. Default is enable. If optOut, no configuration change will be made on source. [AdditionalConfiguration ]: A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this property is to full fill more customized configurations [(Any) ]: This indicates any property can be added to this object. [CustomizedKey ]: Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be used for generate configurations [(Any) ]: This indicates any property can be added to this object. - [DeleteOrUpdateBehavior ]: Indicates whether to clean up previous operation when Linker is updating or deleting + [DeleteOrUpdateBehavior ]: Indicates whether to clean up previous operation when Linker is updating or deleting .Link https://learn.microsoft.com/powershell/module/az.servicelinker/new-azservicelinkerconfiguration #> function New-AzServiceLinkerConfiguration { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult])] [CmdletBinding(DefaultParameterSetName='GenerateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Generate', Mandatory)] [Parameter(ParameterSetName='GenerateExpanded', Mandatory)] + [Parameter(ParameterSetName='GenerateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='GenerateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] [System.String] # The name Linker resource. @@ -68,6 +70,8 @@ param( [Parameter(ParameterSetName='Generate', Mandatory)] [Parameter(ParameterSetName='GenerateExpanded', Mandatory)] + [Parameter(ParameterSetName='GenerateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='GenerateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] [System.String] # The fully qualified Azure Resource manager identifier of the resource to be connected. @@ -78,22 +82,20 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='Generate', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='GenerateViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo] # The configuration information, used to generate configurations or save to applications - # To construct, see NOTES section for PARAMETER properties and create a hash table. ${Parameter}, [Parameter(ParameterSetName='GenerateExpanded')] [Parameter(ParameterSetName='GenerateViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType] + [System.String] # Optional, indicate whether to apply configurations on source application. # If enable, generate configurations and applied to the source application. # Default is enable. @@ -103,7 +105,7 @@ param( [Parameter(ParameterSetName='GenerateExpanded')] [Parameter(ParameterSetName='GenerateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations]))] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations]))] [System.Collections.Hashtable] # A dictionary of additional configurations to be added. # Service will auto generate a set of basic configurations and this property is to full fill more customized configurations @@ -112,13 +114,25 @@ param( [Parameter(ParameterSetName='GenerateExpanded')] [Parameter(ParameterSetName='GenerateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys]))] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys]))] [System.Collections.Hashtable] # Optional. # A dictionary of default key name and customized key name mapping. # If not specified, default key name will be used for generate configurations ${CustomizedKey}, + [Parameter(ParameterSetName='GenerateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] + [System.String] + # Path of Json file supplied to the Generate operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='GenerateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] + [System.String] + # Json string supplied to the Generate operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -175,15 +189,23 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Generate = 'Az.ServiceLinker.private\New-AzServiceLinkerConfiguration_Generate'; GenerateExpanded = 'Az.ServiceLinker.private\New-AzServiceLinkerConfiguration_GenerateExpanded'; GenerateViaIdentity = 'Az.ServiceLinker.private\New-AzServiceLinkerConfiguration_GenerateViaIdentity'; GenerateViaIdentityExpanded = 'Az.ServiceLinker.private\New-AzServiceLinkerConfiguration_GenerateViaIdentityExpanded'; + GenerateViaJsonFilePath = 'Az.ServiceLinker.private\New-AzServiceLinkerConfiguration_GenerateViaJsonFilePath'; + GenerateViaJsonString = 'Az.ServiceLinker.private\New-AzServiceLinkerConfiguration_GenerateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/internal/New-AzServiceLinkerDryrun.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/internal/New-AzServiceLinkerDryrun.ps1 index 87a442d40842..a847ac8cd975 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/internal/New-AzServiceLinkerDryrun.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/internal/New-AzServiceLinkerDryrun.ps1 @@ -24,27 +24,49 @@ create a dryrun job to do necessary check before actual creation .Example {{ Add code here }} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource +.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 + [ConnectorName ]: The name of resource. + [DryrunName ]: The name of dryrun. + [Id ]: Resource identity path + [LinkerName ]: The name Linker resource. + [Location ]: The name of Azure region. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. + [SubscriptionId ]: The ID of the target subscription. .Link https://learn.microsoft.com/powershell/module/az.servicelinker/new-azservicelinkerdryrun #> function New-AzServiceLinkerDryrun { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] [System.String] # The name of dryrun. ${DryrunName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] [System.String] # The fully qualified Azure Resource manager identifier of the resource to be connected. ${ResourceUri}, + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity] + # Identity Parameter + ${InputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -113,12 +135,19 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ CreateExpanded = 'Az.ServiceLinker.private\New-AzServiceLinkerDryrun_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.ServiceLinker.private\New-AzServiceLinkerDryrun_CreateViaIdentityExpanded'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/internal/ProxyCmdletDefinitions.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/internal/ProxyCmdletDefinitions.ps1 index a4c015d2d1f4..c8bc91ee0eae 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -25,12 +25,12 @@ list source configurations for a Linker. {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult .Link https://learn.microsoft.com/powershell/module/az.servicelinker/get-azservicelinkerconfiguration #> function Get-AzServiceLinkerConfiguration { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -101,12 +101,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.ServiceLinker.private\Get-AzServiceLinkerConfiguration_List'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -149,7 +155,7 @@ get a dryrun job .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource .Notes COMPLEX PARAMETER PROPERTIES @@ -168,7 +174,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.servicelinker/get-azservicelinkerdryrun #> function Get-AzServiceLinkerDryrun { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -188,7 +194,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -247,6 +252,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Get = 'Az.ServiceLinker.private\Get-AzServiceLinkerDryrun_Get'; @@ -255,6 +263,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -295,12 +306,12 @@ Lists the available ServiceLinker REST API operations. {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperation +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperation .Link https://learn.microsoft.com/powershell/module/az.servicelinker/get-azservicelinkeroperation #> function Get-AzServiceLinkerOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api30.IOperation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IOperation])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -359,12 +370,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.ServiceLinker.private\Get-AzServiceLinkerOperation_List'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -407,7 +424,7 @@ Returns Linker resource for a given name. .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource .Notes COMPLEX PARAMETER PROPERTIES @@ -426,7 +443,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.servicelinker/get-azservicelinker #> function Get-AzServiceLinker { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -447,7 +464,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -506,6 +522,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Get = 'Az.ServiceLinker.private\Get-AzServiceLinker_Get'; @@ -514,6 +533,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -554,11 +576,11 @@ Generate configurations for a Linker. {{ Add code here }} .Inputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult .Notes COMPLEX PARAMETER PROPERTIES @@ -575,21 +597,23 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. PARAMETER : The configuration information, used to generate configurations or save to applications - [Action ]: Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied to the source application. Default is enable. If optOut, no configuration change will be made on source. + [Action ]: Optional, indicate whether to apply configurations on source application. If enable, generate configurations and applied to the source application. Default is enable. If optOut, no configuration change will be made on source. [AdditionalConfiguration ]: A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this property is to full fill more customized configurations [(Any) ]: This indicates any property can be added to this object. [CustomizedKey ]: Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be used for generate configurations [(Any) ]: This indicates any property can be added to this object. - [DeleteOrUpdateBehavior ]: Indicates whether to clean up previous operation when Linker is updating or deleting + [DeleteOrUpdateBehavior ]: Indicates whether to clean up previous operation when Linker is updating or deleting .Link https://learn.microsoft.com/powershell/module/az.servicelinker/new-azservicelinkerconfiguration #> function New-AzServiceLinkerConfiguration { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ISourceConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationResult])] [CmdletBinding(DefaultParameterSetName='GenerateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Generate', Mandatory)] [Parameter(ParameterSetName='GenerateExpanded', Mandatory)] + [Parameter(ParameterSetName='GenerateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='GenerateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] [System.String] # The name Linker resource. @@ -597,6 +621,8 @@ param( [Parameter(ParameterSetName='Generate', Mandatory)] [Parameter(ParameterSetName='GenerateExpanded', Mandatory)] + [Parameter(ParameterSetName='GenerateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='GenerateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] [System.String] # The fully qualified Azure Resource manager identifier of the resource to be connected. @@ -607,22 +633,20 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='Generate', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='GenerateViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfo] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfo] # The configuration information, used to generate configurations or save to applications - # To construct, see NOTES section for PARAMETER properties and create a hash table. ${Parameter}, [Parameter(ParameterSetName='GenerateExpanded')] [Parameter(ParameterSetName='GenerateViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType] + [System.String] # Optional, indicate whether to apply configurations on source application. # If enable, generate configurations and applied to the source application. # Default is enable. @@ -632,7 +656,7 @@ param( [Parameter(ParameterSetName='GenerateExpanded')] [Parameter(ParameterSetName='GenerateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations]))] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations]))] [System.Collections.Hashtable] # A dictionary of additional configurations to be added. # Service will auto generate a set of basic configurations and this property is to full fill more customized configurations @@ -641,13 +665,25 @@ param( [Parameter(ParameterSetName='GenerateExpanded')] [Parameter(ParameterSetName='GenerateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys]))] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys]))] [System.Collections.Hashtable] # Optional. # A dictionary of default key name and customized key name mapping. # If not specified, default key name will be used for generate configurations ${CustomizedKey}, + [Parameter(ParameterSetName='GenerateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] + [System.String] + # Path of Json file supplied to the Generate operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='GenerateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] + [System.String] + # Json string supplied to the Generate operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -704,15 +740,23 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Generate = 'Az.ServiceLinker.private\New-AzServiceLinkerConfiguration_Generate'; GenerateExpanded = 'Az.ServiceLinker.private\New-AzServiceLinkerConfiguration_GenerateExpanded'; GenerateViaIdentity = 'Az.ServiceLinker.private\New-AzServiceLinkerConfiguration_GenerateViaIdentity'; GenerateViaIdentityExpanded = 'Az.ServiceLinker.private\New-AzServiceLinkerConfiguration_GenerateViaIdentityExpanded'; + GenerateViaJsonFilePath = 'Az.ServiceLinker.private\New-AzServiceLinkerConfiguration_GenerateViaJsonFilePath'; + GenerateViaJsonString = 'Az.ServiceLinker.private\New-AzServiceLinkerConfiguration_GenerateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -752,27 +796,49 @@ create a dryrun job to do necessary check before actual creation .Example {{ Add code here }} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource +.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 + [ConnectorName ]: The name of resource. + [DryrunName ]: The name of dryrun. + [Id ]: Resource identity path + [LinkerName ]: The name Linker resource. + [Location ]: The name of Azure region. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. + [SubscriptionId ]: The ID of the target subscription. .Link https://learn.microsoft.com/powershell/module/az.servicelinker/new-azservicelinkerdryrun #> function New-AzServiceLinkerDryrun { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] [System.String] # The name of dryrun. ${DryrunName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] [System.String] # The fully qualified Azure Resource manager identifier of the resource to be connected. ${ResourceUri}, + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity] + # Identity Parameter + ${InputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -841,12 +907,19 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ CreateExpanded = 'Az.ServiceLinker.private\New-AzServiceLinkerDryrun_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.ServiceLinker.private\New-AzServiceLinkerDryrun_CreateViaIdentityExpanded'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -878,40 +951,46 @@ end { <# .Synopsis -Create or update Linker resource. +create Linker resource. .Description -Create or update Linker resource. +create Linker resource. .Example {{ Add code here }} .Example {{ Add code here }} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource .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. AUTHINFO : The authentication type. - AuthType : The authentication type. + AuthType : The authentication type. + +INPUTOBJECT : Identity Parameter + [ConnectorName ]: The name of resource. + [DryrunName ]: The name of dryrun. + [Id ]: Resource identity path + [LinkerName ]: The name Linker resource. + [Location ]: The name of Azure region. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. + [SubscriptionId ]: The ID of the target subscription. TARGETSERVICE : The target service properties - Type : The target service type. + Type : The target service type. .Link https://learn.microsoft.com/powershell/module/az.servicelinker/new-azservicelinker #> function New-AzServiceLinker { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] - [System.String] - # The fully qualified Azure Resource manager identifier of the resource to be connected. - ${ResourceUri}, - - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Alias('LinkerName')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo(Script='"connect_"+(-join ((65..90) + (97..122) | Get-Random -Count 5 | % {[char]$_}))')] @@ -919,6 +998,18 @@ param( # The name Linker resource. ${Name}, + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] + [System.String] + # The fully qualified Azure Resource manager identifier of the resource to be connected. + ${ResourceUri}, + + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity] + # Identity Parameter + ${InputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Header')] [System.String] @@ -927,23 +1018,22 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase] # The authentication type. - # To construct, see NOTES section for AUTHINFO properties and create a hash table. ${AuthInfo}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.DefaultInfo(Script='"none"')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType] + [System.String] # The application client type ${ClientType}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType] + [System.String] # Optional, indicate whether to apply configurations on source application. # If enable, generate configurations and applied to the source application. # Default is enable. @@ -952,7 +1042,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations]))] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations]))] [System.Collections.Hashtable] # A dictionary of additional configurations to be added. # Service will auto generate a set of basic configurations and this property is to full fill more customized configurations @@ -960,7 +1050,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys]))] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys]))] [System.Collections.Hashtable] # Optional. # A dictionary of default key name and customized key name mapping. @@ -968,16 +1058,16 @@ param( ${ConfigurationInfoCustomizedKey}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType] + [System.String] # Allow Azure services to access the target service if true. ${FirewallRuleAzureService}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType] + [System.String] # Allow caller client IP to access the target service if true. # the property is used when connecting local application to target service. ${FirewallRuleCallerClientIP}, @@ -990,9 +1080,9 @@ param( ${FirewallRuleIPRange}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType] + [System.String] # Optional. # Indicates public network solution. # If enable, enable public network access of target service with best try. @@ -1020,15 +1110,14 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase] # The target service properties - # To construct, see NOTES section for TARGETSERVICE properties and create a hash table. ${TargetService}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType] + [System.String] # Type of VNet solution. ${VNetSolutionType}, @@ -1100,18 +1189,25 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ CreateExpanded = 'Az.ServiceLinker.private\New-AzServiceLinker_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.ServiceLinker.private\New-AzServiceLinker_CreateViaIdentityExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Name')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Name') ) { $PSBoundParameters['Name'] = "connect_"+(-join ((65..90) + (97..122) | Get-Random -Count 5 | % {[char]$_})) } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('ClientType')) { + if (('CreateExpanded', 'CreateViaIdentityExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('ClientType') ) { $PSBoundParameters['ClientType'] = "none" } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1192,7 +1288,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -1257,6 +1352,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Delete = 'Az.ServiceLinker.private\Remove-AzServiceLinkerDryrun_Delete'; @@ -1264,6 +1362,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1345,7 +1446,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -1422,6 +1522,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Delete = 'Az.ServiceLinker.private\Remove-AzServiceLinker_Delete'; @@ -1429,6 +1532,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1471,7 +1577,7 @@ Validate a Linker. .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResult +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResult .Notes COMPLEX PARAMETER PROPERTIES @@ -1490,7 +1596,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.servicelinker/test-azservicelinker #> function Test-AzServiceLinker { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResult])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResult])] [CmdletBinding(DefaultParameterSetName='Validate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Validate', Mandatory)] @@ -1510,7 +1616,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -1581,6 +1686,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Validate = 'Az.ServiceLinker.private\Test-AzServiceLinker_Validate'; @@ -1588,6 +1696,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1630,7 +1741,7 @@ add a dryrun job to do necessary check before actual creation .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource .Notes COMPLEX PARAMETER PROPERTIES @@ -1649,7 +1760,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.servicelinker/update-azservicelinkerdryrun #> function Update-AzServiceLinkerDryrun { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -1668,7 +1779,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -1739,6 +1849,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ UpdateExpanded = 'Az.ServiceLinker.private\Update-AzServiceLinkerDryrun_UpdateExpanded'; @@ -1746,6 +1859,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1788,14 +1904,14 @@ Operation to update an existing Linker. .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource .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. AUTHINFO : The authentication type. - AuthType : The authentication type. + AuthType : The authentication type. INPUTOBJECT : Identity Parameter [ConnectorName ]: The name of resource. @@ -1808,12 +1924,12 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. TARGETSERVICE : The target service properties - Type : The target service type. + Type : The target service type. .Link https://learn.microsoft.com/powershell/module/az.servicelinker/update-azservicelinker #> function Update-AzServiceLinker { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -1833,7 +1949,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -1844,22 +1959,21 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase] # The authentication type. - # To construct, see NOTES section for AUTHINFO properties and create a hash table. ${AuthInfo}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType] + [System.String] # The application client type ${ClientType}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType] + [System.String] # Optional, indicate whether to apply configurations on source application. # If enable, generate configurations and applied to the source application. # Default is enable. @@ -1868,7 +1982,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations]))] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations]))] [System.Collections.Hashtable] # A dictionary of additional configurations to be added. # Service will auto generate a set of basic configurations and this property is to full fill more customized configurations @@ -1876,7 +1990,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys]))] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys]))] [System.Collections.Hashtable] # Optional. # A dictionary of default key name and customized key name mapping. @@ -1884,16 +1998,16 @@ param( ${ConfigurationInfoCustomizedKey}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType] + [System.String] # Allow Azure services to access the target service if true. ${FirewallRuleAzureService}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType] + [System.String] # Allow caller client IP to access the target service if true. # the property is used when connecting local application to target service. ${FirewallRuleCallerClientIP}, @@ -1906,9 +2020,9 @@ param( ${FirewallRuleIPRange}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType] + [System.String] # Optional. # Indicates public network solution. # If enable, enable public network access of target service with best try. @@ -1936,15 +2050,14 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase] # The target service properties - # To construct, see NOTES section for TARGETSERVICE properties and create a hash table. ${TargetService}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType] + [System.String] # Type of VNet solution. ${VNetSolutionType}, @@ -2016,6 +2129,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ UpdateExpanded = 'Az.ServiceLinker.private\Update-AzServiceLinker_UpdateExpanded'; @@ -2023,6 +2139,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/internal/Remove-AzServiceLinker.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/internal/Remove-AzServiceLinker.ps1 index 98f86671a14b..250ef0ac05a9 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/internal/Remove-AzServiceLinker.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/internal/Remove-AzServiceLinker.ps1 @@ -66,7 +66,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -143,6 +142,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Delete = 'Az.ServiceLinker.private\Remove-AzServiceLinker_Delete'; @@ -150,6 +152,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/internal/Remove-AzServiceLinkerDryrun.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/internal/Remove-AzServiceLinkerDryrun.ps1 index e5960ae9dc5b..d7051e9f1f25 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/internal/Remove-AzServiceLinkerDryrun.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/internal/Remove-AzServiceLinkerDryrun.ps1 @@ -65,7 +65,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -130,6 +129,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Delete = 'Az.ServiceLinker.private\Remove-AzServiceLinkerDryrun_Delete'; @@ -137,6 +139,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/internal/Test-AzServiceLinker.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/internal/Test-AzServiceLinker.ps1 index da17c23895b4..0564bf0b4328 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/internal/Test-AzServiceLinker.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/internal/Test-AzServiceLinker.ps1 @@ -27,7 +27,7 @@ Validate a Linker. .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResult +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResult .Notes COMPLEX PARAMETER PROPERTIES @@ -46,7 +46,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.servicelinker/test-azservicelinker #> function Test-AzServiceLinker { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IValidateOperationResult])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IValidateOperationResult])] [CmdletBinding(DefaultParameterSetName='Validate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Validate', Mandatory)] @@ -66,7 +66,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -137,6 +136,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Validate = 'Az.ServiceLinker.private\Test-AzServiceLinker_Validate'; @@ -144,6 +146,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/internal/Update-AzServiceLinker.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/internal/Update-AzServiceLinker.ps1 index 44922c448760..8572a965f878 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/internal/Update-AzServiceLinker.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/internal/Update-AzServiceLinker.ps1 @@ -27,14 +27,14 @@ Operation to update an existing Linker. .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource .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. AUTHINFO : The authentication type. - AuthType : The authentication type. + AuthType : The authentication type. INPUTOBJECT : Identity Parameter [ConnectorName ]: The name of resource. @@ -47,12 +47,12 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. TARGETSERVICE : The target service properties - Type : The target service type. + Type : The target service type. .Link https://learn.microsoft.com/powershell/module/az.servicelinker/update-azservicelinker #> function Update-AzServiceLinker { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ILinkerResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ILinkerResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -72,7 +72,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -83,22 +82,21 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IAuthInfoBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IAuthInfoBase] # The authentication type. - # To construct, see NOTES section for AUTHINFO properties and create a hash table. ${AuthInfo}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("none", "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ClientType] + [System.String] # The application client type ${ClientType}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType] + [System.String] # Optional, indicate whether to apply configurations on source application. # If enable, generate configurations and applied to the source application. # Default is enable. @@ -107,7 +105,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoAdditionalConfigurations]))] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoAdditionalConfigurations]))] [System.Collections.Hashtable] # A dictionary of additional configurations to be added. # Service will auto generate a set of basic configurations and this property is to full fill more customized configurations @@ -115,7 +113,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IConfigurationInfoCustomizedKeys]))] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IConfigurationInfoCustomizedKeys]))] [System.Collections.Hashtable] # Optional. # A dictionary of default key name and customized key name mapping. @@ -123,16 +121,16 @@ param( ${ConfigurationInfoCustomizedKey}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType] + [System.String] # Allow Azure services to access the target service if true. ${FirewallRuleAzureService}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("true", "false")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.AllowType] + [System.String] # Allow caller client IP to access the target service if true. # the property is used when connecting local application to target service. ${FirewallRuleCallerClientIP}, @@ -145,9 +143,9 @@ param( ${FirewallRuleIPRange}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("Internal", "enable", "optOut")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.ActionType] + [System.String] # Optional. # Indicates public network solution. # If enable, enable public network access of target service with best try. @@ -175,15 +173,14 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.ITargetServiceBase] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.ITargetServiceBase] # The target service properties - # To construct, see NOTES section for TARGETSERVICE properties and create a hash table. ${TargetService}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType])] + [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.PSArgumentCompleterAttribute("serviceEndpoint", "privateLink")] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Support.VNetSolutionType] + [System.String] # Type of VNet solution. ${VNetSolutionType}, @@ -255,6 +252,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ UpdateExpanded = 'Az.ServiceLinker.private\Update-AzServiceLinker_UpdateExpanded'; @@ -262,6 +262,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/internal/Update-AzServiceLinkerDryrun.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/internal/Update-AzServiceLinkerDryrun.ps1 index 54072ffd54fb..70b28a146326 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/internal/Update-AzServiceLinkerDryrun.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/internal/Update-AzServiceLinkerDryrun.ps1 @@ -27,7 +27,7 @@ add a dryrun job to do necessary check before actual creation .Inputs Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource +Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource .Notes COMPLEX PARAMETER PROPERTIES @@ -46,7 +46,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.servicelinker/update-azservicelinkerdryrun #> function Update-AzServiceLinkerDryrun { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.Api20221101Preview.IDryrunResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IDryrunResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -65,7 +65,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Models.IServiceLinkerIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -136,6 +135,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ServiceLinker.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ UpdateExpanded = 'Az.ServiceLinker.private\Update-AzServiceLinkerDryrun_UpdateExpanded'; @@ -143,6 +145,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ServiceLinker/ServiceLinker.Autorest/resources/README.md b/generated/ServiceLinker/ServiceLinker.Autorest/resources/README.md new file mode 100644 index 000000000000..937f07f8fec2 --- /dev/null +++ b/generated/ServiceLinker/ServiceLinker.Autorest/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/generated/ServiceLinker/ServiceLinker.Autorest/test-module.ps1 b/generated/ServiceLinker/ServiceLinker.Autorest/test-module.ps1 index c3c241276fbb..bd37c3a58068 100644 --- a/generated/ServiceLinker/ServiceLinker.Autorest/test-module.ps1 +++ b/generated/ServiceLinker/ServiceLinker.Autorest/test-module.ps1 @@ -12,17 +12,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code # is regenerated. # ---------------------------------------------------------------------------------- -param([switch]$Isolated, [switch]$Live, [switch]$Record, [switch]$Playback, [switch]$RegenerateSupportModule, [switch]$UsePreviousConfigForRecord, [string[]]$TestName) +param([switch]$NotIsolated, [switch]$Live, [switch]$Record, [switch]$Playback, [switch]$RegenerateSupportModule, [switch]$UsePreviousConfigForRecord, [string[]]$TestName) $ErrorActionPreference = 'Stop' -if(-not $Isolated) +if(-not $NotIsolated) { Write-Host -ForegroundColor Green 'Creating isolated process...' if ($PSBoundParameters.ContainsKey("TestName")) { $PSBoundParameters["TestName"] = $PSBoundParameters["TestName"] -join "," } $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path - & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated return } @@ -34,7 +34,7 @@ if ($PSBoundParameters.ContainsKey("TestName") -and ($TestName.count -eq 1) -and $ProgressPreference = 'SilentlyContinue' $baseName = $PSScriptRoot.BaseName $requireResourceModule = (($baseName -ne "Resources") -and ($Record.IsPresent -or $Live.IsPresent)) -. (Join-Path $PSScriptRoot 'check-dependencies.ps1') -Isolated -Accounts:$false -Pester -Resources:$requireResourceModule -RegenerateSupportModule:$RegenerateSupportModule +. (Join-Path $PSScriptRoot 'check-dependencies.ps1') -NotIsolated -Accounts:$false -Pester -Resources:$requireResourceModule -RegenerateSupportModule:$RegenerateSupportModule . ("$PSScriptRoot\test\utils.ps1") if ($requireResourceModule) @@ -95,4 +95,4 @@ try } } -Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file +Write-Host -ForegroundColor Green '-------------Done-------------'