From 720e76f1e8728ff1c45b1abb08040600d78b8e98 Mon Sep 17 00:00:00 2001 From: azure-powershell-bot <65331932+azure-powershell-bot@users.noreply.github.com> Date: Wed, 16 Apr 2025 05:59:41 +0000 Subject: [PATCH] [skip ci] Archive 93cb433003d5d633b58d35b9c69bab31f2c5bf83 --- .../Confluent.Autorest/Az.Confluent.csproj | 2 +- .../Az.Confluent.format.ps1xml | 224 +- .../Confluent.Autorest/Az.Confluent.psd1 | 3 +- .../Properties/AssemblyInfo.cs | 30 +- .../Confluent.Autorest/check-dependencies.ps1 | 6 +- .../Get-AzConfluentMarketplaceAgreement.ps1 | 20 +- .../exports/Get-AzConfluentOrganization.ps1 | 21 +- .../exports/New-AzConfluentOrganization.ps1 | 60 +- .../exports/ProxyCmdletDefinitions.ps1 | 169 +- .../Remove-AzConfluentOrganization.ps1 | 18 +- .../Update-AzConfluentOrganization.ps1 | 50 +- .../Confluent.Autorest/generate-info.json | 2 +- .../Confluent.Autorest/generated/Module.cs | 27 +- .../generated/api/Confluent.cs | 2839 +++++++++++++---- .../OrganizationResource.PowerShell.cs | 304 -- ...ganizationResourceProperties.PowerShell.cs | 258 -- ...ourcePropertiesAutoGenerated.PowerShell.cs | 261 -- ...nizationResourcePropertiesAutoGenerated.cs | 130 - ...ConfluentAgreementProperties.PowerShell.cs | 74 +- ...fluentAgreementProperties.TypeConverter.cs | 6 +- .../ConfluentAgreementProperties.cs | 30 +- .../ConfluentAgreementProperties.json.cs | 24 +- .../ConfluentAgreementResource.PowerShell.cs | 90 +- ...onfluentAgreementResource.TypeConverter.cs | 6 +- .../ConfluentAgreementResource.cs | 73 +- .../ConfluentAgreementResource.json.cs | 22 +- ...greementResourceListResponse.PowerShell.cs | 48 +- ...ementResourceListResponse.TypeConverter.cs | 6 +- .../ConfluentAgreementResourceListResponse.cs | 22 +- ...luentAgreementResourceListResponse.json.cs | 12 +- .../Models/ConfluentIdentity.PowerShell.cs | 20 + .../generated/api/Models/ConfluentIdentity.cs | 12 + .../api/Models/ConfluentIdentity.json.cs | 8 +- .../ErrorResponseBody.PowerShell.cs | 56 +- .../ErrorResponseBody.TypeConverter.cs | 6 +- .../{Api20200301 => }/ErrorResponseBody.cs | 36 +- .../ErrorResponseBody.json.cs | 24 +- .../OfferDetail.PowerShell.cs | 64 +- .../OfferDetail.TypeConverter.cs | 6 +- .../Models/{Api20200301 => }/OfferDetail.cs | 38 +- .../{Api20200301 => }/OfferDetail.json.cs | 22 +- .../OperationDisplay.PowerShell.cs | 56 +- .../OperationDisplay.TypeConverter.cs | 6 +- .../{Api20200301 => }/OperationDisplay.cs | 18 +- .../OperationDisplay.json.cs | 16 +- .../OperationListResult.PowerShell.cs | 48 +- .../OperationListResult.TypeConverter.cs | 6 +- .../{Api20200301 => }/OperationListResult.cs | 24 +- .../OperationListResult.json.cs | 14 +- .../OperationResult.PowerShell.cs | 68 +- .../OperationResult.TypeConverter.cs | 6 +- .../{Api20200301 => }/OperationResult.cs | 40 +- .../{Api20200301 => }/OperationResult.json.cs | 14 +- .../Models/OrganizationResource.PowerShell.cs | 324 ++ .../OrganizationResource.TypeConverter.cs | 6 +- .../{Api20200301 => }/OrganizationResource.cs | 148 +- .../OrganizationResource.json.cs | 26 +- ...ganizationResourceListResult.PowerShell.cs | 50 +- ...izationResourceListResult.TypeConverter.cs | 6 +- .../OrganizationResourceListResult.cs | 22 +- .../OrganizationResourceListResult.json.cs | 12 +- ...ganizationResourceProperties.PowerShell.cs | 276 ++ ...izationResourceProperties.TypeConverter.cs | 6 +- .../Models/OrganizationResourceProperties.cs | 134 + ...=> OrganizationResourceProperties.json.cs} | 26 +- ...ourcePropertiesAutoGenerated.PowerShell.cs | 281 ++ ...cePropertiesAutoGenerated.TypeConverter.cs | 6 +- ...izationResourcePropertiesAutoGenerated.cs} | 121 +- ...onResourcePropertiesAutoGenerated.json.cs} | 42 +- ...esourcePropertiesOfferDetail.PowerShell.cs | 64 +- ...urcePropertiesOfferDetail.TypeConverter.cs | 6 +- ...ganizationResourcePropertiesOfferDetail.cs | 29 +- ...ationResourcePropertiesOfferDetail.json.cs | 10 +- ...ResourcePropertiesUserDetail.PowerShell.cs | 52 +- ...ourcePropertiesUserDetail.TypeConverter.cs | 6 +- ...rganizationResourcePropertiesUserDetail.cs | 21 +- ...zationResourcePropertiesUserDetail.json.cs | 10 +- .../OrganizationResourceTags.PowerShell.cs | 40 +- .../OrganizationResourceTags.TypeConverter.cs | 6 +- .../OrganizationResourceTags.cs | 6 +- .../OrganizationResourceTags.dictionary.cs | 4 +- .../OrganizationResourceTags.json.cs | 8 +- .../OrganizationResourceUpdate.PowerShell.cs | 46 +- ...rganizationResourceUpdate.TypeConverter.cs | 6 +- .../OrganizationResourceUpdate.cs | 19 +- .../OrganizationResourceUpdate.json.cs | 10 +- ...ganizationResourceUpdateTags.PowerShell.cs | 42 +- ...izationResourceUpdateTags.TypeConverter.cs | 6 +- .../OrganizationResourceUpdateTags.cs | 6 +- ...ganizationResourceUpdateTags.dictionary.cs | 4 +- .../OrganizationResourceUpdateTags.json.cs | 8 +- ...ProviderDefaultErrorResponse.PowerShell.cs | 62 +- ...viderDefaultErrorResponse.TypeConverter.cs | 6 +- .../ResourceProviderDefaultErrorResponse.cs | 48 +- ...sourceProviderDefaultErrorResponse.json.cs | 12 +- .../UserDetail.PowerShell.cs | 52 +- .../UserDetail.TypeConverter.cs | 6 +- .../Models/{Api20200301 => }/UserDetail.cs | 15 +- .../{Api20200301 => }/UserDetail.json.cs | 16 +- .../api/Support/ProvisionState.Completer.cs | 67 - .../Support/ProvisionState.TypeConverter.cs | 59 - .../generated/api/Support/ProvisionState.cs | 112 - .../api/Support/SaaSOfferStatus.Completer.cs | 71 - .../Support/SaaSOfferStatus.TypeConverter.cs | 59 - .../generated/api/Support/SaaSOfferStatus.cs | 114 - ...GetAzConfluentMarketplaceAgreement_List.cs | 119 +- ...etAzConfluentOrganizationOperation_List.cs | 112 +- .../cmdlets/GetAzConfluentOrganization_Get.cs | 112 +- ...tAzConfluentOrganization_GetViaIdentity.cs | 105 +- .../GetAzConfluentOrganization_List.cs | 119 +- .../GetAzConfluentOrganization_List1.cs | 119 +- ...wAzConfluentOrganization_CreateExpanded.cs | 142 +- ...luentOrganization_CreateViaJsonFilePath.cs | 607 ++++ ...nfluentOrganization_CreateViaJsonString.cs | 605 ++++ .../RemoveAzConfluentOrganization_Delete.cs | 98 +- ...ConfluentOrganization_DeleteViaIdentity.cs | 91 +- ...eAzConfluentOrganization_UpdateExpanded.cs | 124 +- ...tOrganization_UpdateViaIdentityExpanded.cs | 123 +- ...luentOrganization_UpdateViaJsonFilePath.cs | 524 +++ ...nfluentOrganization_UpdateViaJsonString.cs | 522 +++ .../Attributes/ExternalDocsAttribute.cs | 30 + .../PSArgumentCompleterAttribute.cs | 52 + .../BuildTime/Cmdlets/ExportFormatPs1xml.cs | 6 +- .../BuildTime/Cmdlets/ExportModelSurface.cs | 2 +- .../BuildTime/Cmdlets/ExportProxyCmdlet.cs | 4 +- .../runtime/BuildTime/Cmdlets/ExportPsd1.cs | 8 +- .../BuildTime/Cmdlets/ExportTestStub.cs | 211 +- .../runtime/BuildTime/MarkdownRenderer.cs | 2 +- .../BuildTime/Models/PsMarkdownTypes.cs | 43 +- .../BuildTime/Models/PsProxyOutputs.cs | 60 +- .../runtime/BuildTime/Models/PsProxyTypes.cs | 56 +- .../runtime/BuildTime/PsAttributes.cs | 15 + .../runtime/BuildTime/PsExtensions.cs | 7 + .../generated/runtime/BuildTime/PsHelpers.cs | 4 +- .../generated/runtime/Context.cs | 33 + .../generated/runtime/Events.cs | 4 +- .../generated/runtime/ISendAsync.cs | 113 + .../generated/runtime/InfoAttribute.cs | 4 + .../generated/runtime/InputHandler.cs | 22 + .../runtime/Nodes/Collections/XNodeArray.cs | 5 + .../generated/runtime/SerializationMode.cs | 8 +- .../runtime/TypeConverterExtensions.cs | 50 + .../Get-AzConfluentOrganizationOperation.ps1 | 10 +- .../internal/ProxyCmdletDefinitions.ps1 | 21 +- .../Remove-AzConfluentOrganization.ps1 | 11 +- .../Confluent.Autorest/resources/README.md | 11 + .../Confluent.Autorest/test-module.ps1 | 10 +- 147 files changed, 8954 insertions(+), 3409 deletions(-) delete mode 100644 generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResource.PowerShell.cs delete mode 100644 generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceProperties.PowerShell.cs delete mode 100644 generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesAutoGenerated.PowerShell.cs delete mode 100644 generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesAutoGenerated.cs rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/ConfluentAgreementProperties.PowerShell.cs (60%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/ConfluentAgreementProperties.TypeConverter.cs (96%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/ConfluentAgreementProperties.cs (91%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/ConfluentAgreementProperties.json.cs (91%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/ConfluentAgreementResource.PowerShell.cs (55%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/ConfluentAgreementResource.TypeConverter.cs (96%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/ConfluentAgreementResource.cs (69%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/ConfluentAgreementResource.json.cs (91%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/ConfluentAgreementResourceListResponse.PowerShell.cs (68%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/ConfluentAgreementResourceListResponse.TypeConverter.cs (96%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/ConfluentAgreementResourceListResponse.cs (70%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/ConfluentAgreementResourceListResponse.json.cs (89%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/ErrorResponseBody.PowerShell.cs (66%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/ErrorResponseBody.TypeConverter.cs (97%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/ErrorResponseBody.cs (72%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/ErrorResponseBody.json.cs (87%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OfferDetail.PowerShell.cs (66%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OfferDetail.TypeConverter.cs (97%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OfferDetail.cs (79%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OfferDetail.json.cs (92%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OperationDisplay.PowerShell.cs (69%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OperationDisplay.TypeConverter.cs (97%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OperationDisplay.cs (90%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OperationDisplay.json.cs (93%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OperationListResult.PowerShell.cs (70%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OperationListResult.TypeConverter.cs (97%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OperationListResult.cs (73%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OperationListResult.json.cs (89%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OperationResult.PowerShell.cs (62%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OperationResult.TypeConverter.cs (97%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OperationResult.cs (76%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OperationResult.json.cs (94%) create mode 100644 generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResource.PowerShell.cs rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResource.TypeConverter.cs (97%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResource.cs (58%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResource.json.cs (90%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourceListResult.PowerShell.cs (69%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourceListResult.TypeConverter.cs (96%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourceListResult.cs (71%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourceListResult.json.cs (89%) create mode 100644 generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceProperties.PowerShell.cs rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourceProperties.TypeConverter.cs (96%) create mode 100644 generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceProperties.cs rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301/OrganizationResourcePropertiesAutoGenerated.json.cs => OrganizationResourceProperties.json.cs} (82%) create mode 100644 generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesAutoGenerated.PowerShell.cs rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourcePropertiesAutoGenerated.TypeConverter.cs (96%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301/OrganizationResourceProperties.cs => OrganizationResourcePropertiesAutoGenerated.cs} (61%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301/OrganizationResourceProperties.json.cs => OrganizationResourcePropertiesAutoGenerated.json.cs} (85%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourcePropertiesOfferDetail.PowerShell.cs (66%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourcePropertiesOfferDetail.TypeConverter.cs (96%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourcePropertiesOfferDetail.cs (59%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourcePropertiesOfferDetail.json.cs (93%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourcePropertiesUserDetail.PowerShell.cs (71%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourcePropertiesUserDetail.TypeConverter.cs (96%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourcePropertiesUserDetail.cs (67%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourcePropertiesUserDetail.json.cs (93%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourceTags.PowerShell.cs (80%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourceTags.TypeConverter.cs (96%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourceTags.cs (79%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourceTags.dictionary.cs (95%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourceTags.json.cs (95%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourceUpdate.PowerShell.cs (74%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourceUpdate.TypeConverter.cs (96%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourceUpdate.cs (66%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourceUpdate.json.cs (93%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourceUpdateTags.PowerShell.cs (80%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourceUpdateTags.TypeConverter.cs (96%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourceUpdateTags.cs (78%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourceUpdateTags.dictionary.cs (95%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/OrganizationResourceUpdateTags.json.cs (94%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/ResourceProviderDefaultErrorResponse.PowerShell.cs (61%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/ResourceProviderDefaultErrorResponse.TypeConverter.cs (96%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/ResourceProviderDefaultErrorResponse.cs (58%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/ResourceProviderDefaultErrorResponse.json.cs (92%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/UserDetail.PowerShell.cs (72%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/UserDetail.TypeConverter.cs (97%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/UserDetail.cs (88%) rename generated/Confluent/Confluent.Autorest/generated/api/Models/{Api20200301 => }/UserDetail.json.cs (92%) delete mode 100644 generated/Confluent/Confluent.Autorest/generated/api/Support/ProvisionState.Completer.cs delete mode 100644 generated/Confluent/Confluent.Autorest/generated/api/Support/ProvisionState.TypeConverter.cs delete mode 100644 generated/Confluent/Confluent.Autorest/generated/api/Support/ProvisionState.cs delete mode 100644 generated/Confluent/Confluent.Autorest/generated/api/Support/SaaSOfferStatus.Completer.cs delete mode 100644 generated/Confluent/Confluent.Autorest/generated/api/Support/SaaSOfferStatus.TypeConverter.cs delete mode 100644 generated/Confluent/Confluent.Autorest/generated/api/Support/SaaSOfferStatus.cs create mode 100644 generated/Confluent/Confluent.Autorest/generated/cmdlets/NewAzConfluentOrganization_CreateViaJsonFilePath.cs create mode 100644 generated/Confluent/Confluent.Autorest/generated/cmdlets/NewAzConfluentOrganization_CreateViaJsonString.cs create mode 100644 generated/Confluent/Confluent.Autorest/generated/cmdlets/UpdateAzConfluentOrganization_UpdateViaJsonFilePath.cs create mode 100644 generated/Confluent/Confluent.Autorest/generated/cmdlets/UpdateAzConfluentOrganization_UpdateViaJsonString.cs create mode 100644 generated/Confluent/Confluent.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs create mode 100644 generated/Confluent/Confluent.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs create mode 100644 generated/Confluent/Confluent.Autorest/generated/runtime/Context.cs create mode 100644 generated/Confluent/Confluent.Autorest/generated/runtime/InputHandler.cs create mode 100644 generated/Confluent/Confluent.Autorest/resources/README.md diff --git a/generated/Confluent/Confluent.Autorest/Az.Confluent.csproj b/generated/Confluent/Confluent.Autorest/Az.Confluent.csproj index e20245842bcf..9ef9f2f8c9bf 100644 --- a/generated/Confluent/Confluent.Autorest/Az.Confluent.csproj +++ b/generated/Confluent/Confluent.Autorest/Az.Confluent.csproj @@ -2,9 +2,9 @@ Confluent Confluent + Confluent.Autorest - diff --git a/generated/Confluent/Confluent.Autorest/Az.Confluent.format.ps1xml b/generated/Confluent/Confluent.Autorest/Az.Confluent.format.ps1xml index 33a8787c55e7..1280c7619303 100644 --- a/generated/Confluent/Confluent.Autorest/Az.Confluent.format.ps1xml +++ b/generated/Confluent/Confluent.Autorest/Az.Confluent.format.ps1xml @@ -2,43 +2,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ConfluentIdentity + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ConfluentAgreementProperties - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ConfluentIdentity - - - - - - - - - - - - - - - - - - OrganizationName - - - ResourceGroupName - - - SubscriptionId - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ConfluentAgreementProperties - - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ConfluentAgreementProperties + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ConfluentAgreementProperties#Multiple @@ -100,15 +66,18 @@ - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ConfluentAgreementResource + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ConfluentAgreementResource - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ConfluentAgreementResource + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ConfluentAgreementResource#Multiple + + + @@ -116,15 +85,18 @@ Name + + ResourceGroupName + - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ConfluentAgreementResourceListResponse + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ConfluentAgreementResourceListResponse - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ConfluentAgreementResourceListResponse + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ConfluentAgreementResourceListResponse#Multiple @@ -144,9 +116,43 @@ - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ErrorResponseBody + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ConfluentIdentity + + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ConfluentIdentity#Multiple + + + + + + + + + + + + + + + + + + OrganizationName + + + ResourceGroupName + + + SubscriptionId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ErrorResponseBody - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ErrorResponseBody + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ErrorResponseBody#Multiple @@ -178,9 +184,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OfferDetail + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OfferDetail - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OfferDetail + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OfferDetail#Multiple @@ -224,9 +230,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OperationDisplay + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OperationDisplay - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OperationDisplay + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OperationDisplay#Multiple @@ -264,9 +270,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OperationListResult + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OperationListResult - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OperationListResult + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OperationListResult#Multiple @@ -286,9 +292,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OperationResult + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OperationResult - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OperationResult + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OperationResult#Multiple @@ -314,9 +320,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResource + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResource - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResource + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResource#Multiple @@ -326,6 +332,9 @@ + + + @@ -336,27 +345,8 @@ Name - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceListResult - - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceListResult - - - - - - - - - - - NextLink + ResourceGroupName @@ -364,39 +354,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceProperties + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceListResult - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceProperties + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceListResult#Multiple - - - - - - - - - - + - CreatedTime - - - OrganizationId - - - ProvisioningState - - - SsoUrl + NextLink @@ -404,9 +376,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourcePropertiesAutoGenerated + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceProperties - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourcePropertiesAutoGenerated + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceProperties#Multiple @@ -498,9 +470,49 @@ - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourcePropertiesOfferDetail + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesAutoGenerated + + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesAutoGenerated#Multiple + + + + + + + + + + + + + + + + + + + + + CreatedTime + + + OrganizationId + + + ProvisioningState + + + SsoUrl + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesOfferDetail - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourcePropertiesOfferDetail + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesOfferDetail#Multiple @@ -544,9 +556,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourcePropertiesUserDetail + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesUserDetail - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourcePropertiesUserDetail + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesUserDetail#Multiple @@ -578,9 +590,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceTags + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceTags - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceTags + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceTags#Multiple @@ -600,9 +612,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceUpdateTags + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceUpdateTags - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceUpdateTags + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceUpdateTags#Multiple @@ -622,9 +634,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.UserDetail + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.UserDetail - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.UserDetail + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.UserDetail#Multiple diff --git a/generated/Confluent/Confluent.Autorest/Az.Confluent.psd1 b/generated/Confluent/Confluent.Autorest/Az.Confluent.psd1 index 0f3fd4588c33..7be318fdfcbb 100644 --- a/generated/Confluent/Confluent.Autorest/Az.Confluent.psd1 +++ b/generated/Confluent/Confluent.Autorest/Az.Confluent.psd1 @@ -11,8 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.Confluent.private.dll' FormatsToProcess = './Az.Confluent.format.ps1xml' - FunctionsToExport = 'Get-AzConfluentMarketplaceAgreement', 'Get-AzConfluentOrganization', 'New-AzConfluentOrganization', 'Remove-AzConfluentOrganization', 'Update-AzConfluentOrganization', '*' - AliasesToExport = '*' + FunctionsToExport = 'Get-AzConfluentMarketplaceAgreement', 'Get-AzConfluentOrganization', 'New-AzConfluentOrganization', 'Remove-AzConfluentOrganization', 'Update-AzConfluentOrganization' PrivateData = @{ PSData = @{ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Confluent' diff --git a/generated/Confluent/Confluent.Autorest/Properties/AssemblyInfo.cs b/generated/Confluent/Confluent.Autorest/Properties/AssemblyInfo.cs index 20107bdf8ab5..b85fa4d2529e 100644 --- a/generated/Confluent/Confluent.Autorest/Properties/AssemblyInfo.cs +++ b/generated/Confluent/Confluent.Autorest/Properties/AssemblyInfo.cs @@ -1,28 +1,26 @@ -// ---------------------------------------------------------------------------------- -// -// 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 - Confluent")] -[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: ComVisible(false)] -[assembly: CLSCompliant(false)] -[assembly: Guid("8eeda931-21bf-422c-b95f-2348dea1a63d")] -[assembly: AssemblyVersion("0.2.2")] -[assembly: AssemblyFileVersion("0.2.2")] +[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 - Confluent")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("0.2.2")] +[assembly: System.Reflection.AssemblyVersionAttribute("0.2.2")] +[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] +[assembly: System.CLSCompliantAttribute(false)] diff --git a/generated/Confluent/Confluent.Autorest/check-dependencies.ps1 b/generated/Confluent/Confluent.Autorest/check-dependencies.ps1 index c29591c7bfe1..90ca9867ae40 100644 --- a/generated/Confluent/Confluent.Autorest/check-dependencies.ps1 +++ b/generated/Confluent/Confluent.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/Confluent/Confluent.Autorest/exports/Get-AzConfluentMarketplaceAgreement.ps1 b/generated/Confluent/Confluent.Autorest/exports/Get-AzConfluentMarketplaceAgreement.ps1 index 5fa02cb4ab9a..c19a38e7d714 100644 --- a/generated/Confluent/Confluent.Autorest/exports/Get-AzConfluentMarketplaceAgreement.ps1 +++ b/generated/Confluent/Confluent.Autorest/exports/Get-AzConfluentMarketplaceAgreement.ps1 @@ -23,12 +23,12 @@ List Confluent marketplace agreements in the subscription. Get-AzConfluentMarketplaceAgreement .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResource +Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResource .Link https://learn.microsoft.com/powershell/module/az.confluent/get-azconfluentmarketplaceagreement #> function Get-AzConfluentMarketplaceAgreement { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -94,6 +94,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -115,9 +124,7 @@ begin { $mapping = @{ List = 'Az.Confluent.private\Get-AzConfluentMarketplaceAgreement_List'; } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Confluent.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 { @@ -131,6 +138,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Confluent/Confluent.Autorest/exports/Get-AzConfluentOrganization.ps1 b/generated/Confluent/Confluent.Autorest/exports/Get-AzConfluentOrganization.ps1 index dfb7eff693d8..8e7264ac101a 100644 --- a/generated/Confluent/Confluent.Autorest/exports/Get-AzConfluentOrganization.ps1 +++ b/generated/Confluent/Confluent.Autorest/exports/Get-AzConfluentOrganization.ps1 @@ -31,7 +31,7 @@ New-AzConfluentOrganization -ResourceGroupName azure-rg-test -Name confluentorg- .Inputs Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource +Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource .Notes COMPLEX PARAMETER PROPERTIES @@ -46,7 +46,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.confluent/get-azconfluentorganization #> function Get-AzConfluentOrganization { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -76,7 +76,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -135,6 +134,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -159,9 +167,7 @@ begin { List = 'Az.Confluent.private\Get-AzConfluentOrganization_List'; List1 = 'Az.Confluent.private\Get-AzConfluentOrganization_List1'; } - if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -175,6 +181,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Confluent/Confluent.Autorest/exports/New-AzConfluentOrganization.ps1 b/generated/Confluent/Confluent.Autorest/exports/New-AzConfluentOrganization.ps1 index 0a7824ff7b14..ee0db19f5ff1 100644 --- a/generated/Confluent/Confluent.Autorest/exports/New-AzConfluentOrganization.ps1 +++ b/generated/Confluent/Confluent.Autorest/exports/New-AzConfluentOrganization.ps1 @@ -16,19 +16,19 @@ <# .Synopsis -Create Organization resource +create Organization resource .Description -Create Organization resource +create Organization resource .Example New-AzConfluentOrganization -ResourceGroupName azure-rg-test -Name confluentorg-02-pwsh -Location eastus -OfferDetailId "confluent-cloud-azure-prod" -OfferDetailPlanId "confluent-cloud-azure-payg-prod" -OfferDetailPlanName "Confluent Cloud - Pay as you Go" -OfferDetailPublisherId "confluentinc" -OfferDetailTermUnit "P1M" -UserDetailEmailAddress "xxxx@microsoft.com" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource +Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource .Link https://learn.microsoft.com/powershell/module/az.confluent/new-azconfluentorganization #> function New-AzConfluentOrganization { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -51,67 +51,79 @@ param( # Microsoft Azure subscription id ${SubscriptionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] [System.String] # Location of Organization resource ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] [System.String] # Offer Id ${OfferDetailId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] [System.String] # Offer Plan Id ${OfferDetailPlanId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] [System.String] # Offer Plan Name ${OfferDetailPlanName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] [System.String] # Publisher Id ${OfferDetailPublisherId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] [System.String] # Offer Plan Term unit ${OfferDetailTermUnit}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceTags]))] [System.Collections.Hashtable] # Organization resource tags ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] [System.String] # Email address ${UserDetailEmailAddress}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] [System.String] # First name ${UserDetailFirstName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] [System.String] # Last name ${UserDetailLastName}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -180,6 +192,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -200,10 +221,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.Confluent.private\New-AzConfluentOrganization_CreateExpanded'; + CreateViaJsonFilePath = 'Az.Confluent.private\New-AzConfluentOrganization_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.Confluent.private\New-AzConfluentOrganization_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -217,6 +238,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Confluent/Confluent.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/Confluent/Confluent.Autorest/exports/ProxyCmdletDefinitions.ps1 index bac71ab77a88..37de151d61d2 100644 --- a/generated/Confluent/Confluent.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/Confluent/Confluent.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -23,12 +23,12 @@ List Confluent marketplace agreements in the subscription. Get-AzConfluentMarketplaceAgreement .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResource +Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResource .Link https://learn.microsoft.com/powershell/module/az.confluent/get-azconfluentmarketplaceagreement #> function Get-AzConfluentMarketplaceAgreement { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -94,6 +94,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -115,9 +124,7 @@ begin { $mapping = @{ List = 'Az.Confluent.private\Get-AzConfluentMarketplaceAgreement_List'; } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Confluent.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 { @@ -131,6 +138,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -191,7 +201,7 @@ New-AzConfluentOrganization -ResourceGroupName azure-rg-test -Name confluentorg- .Inputs Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource +Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource .Notes COMPLEX PARAMETER PROPERTIES @@ -206,7 +216,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.confluent/get-azconfluentorganization #> function Get-AzConfluentOrganization { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -236,7 +246,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -295,6 +304,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -319,9 +337,7 @@ begin { List = 'Az.Confluent.private\Get-AzConfluentOrganization_List'; List1 = 'Az.Confluent.private\Get-AzConfluentOrganization_List1'; } - if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -335,6 +351,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -380,19 +399,19 @@ end { <# .Synopsis -Create Organization resource +create Organization resource .Description -Create Organization resource +create Organization resource .Example New-AzConfluentOrganization -ResourceGroupName azure-rg-test -Name confluentorg-02-pwsh -Location eastus -OfferDetailId "confluent-cloud-azure-prod" -OfferDetailPlanId "confluent-cloud-azure-payg-prod" -OfferDetailPlanName "Confluent Cloud - Pay as you Go" -OfferDetailPublisherId "confluentinc" -OfferDetailTermUnit "P1M" -UserDetailEmailAddress "xxxx@microsoft.com" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource +Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource .Link https://learn.microsoft.com/powershell/module/az.confluent/new-azconfluentorganization #> function New-AzConfluentOrganization { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -415,67 +434,79 @@ param( # Microsoft Azure subscription id ${SubscriptionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] [System.String] # Location of Organization resource ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] [System.String] # Offer Id ${OfferDetailId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] [System.String] # Offer Plan Id ${OfferDetailPlanId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] [System.String] # Offer Plan Name ${OfferDetailPlanName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] [System.String] # Publisher Id ${OfferDetailPublisherId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] [System.String] # Offer Plan Term unit ${OfferDetailTermUnit}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceTags]))] [System.Collections.Hashtable] # Organization resource tags ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] [System.String] # Email address ${UserDetailEmailAddress}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] [System.String] # First name ${UserDetailFirstName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] [System.String] # Last name ${UserDetailLastName}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -544,6 +575,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -564,10 +604,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.Confluent.private\New-AzConfluentOrganization_CreateExpanded'; + CreateViaJsonFilePath = 'Az.Confluent.private\New-AzConfluentOrganization_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.Confluent.private\New-AzConfluentOrganization_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -581,6 +621,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -626,9 +669,9 @@ end { <# .Synopsis -Update Organization resource +update Organization resource .Description -Update Organization resource +update Organization resource .Example Update-AzConfluentOrganization -ResourceGroupName azure-rg-test -Name confluentorg-02-pwsh -Tag @{"key01" = "value01"} .Example @@ -637,7 +680,7 @@ Get-AzConfluentOrganization -ResourceGroupName azure-rg-test -Name confluentorg- .Inputs Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource +Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource .Notes COMPLEX PARAMETER PROPERTIES @@ -652,10 +695,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.confluent/update-azconfluentorganization #> function Update-AzConfluentOrganization { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('OrganizationName')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Path')] [System.String] @@ -663,12 +708,16 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Path')] [System.String] # Resource group name ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -679,16 +728,28 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdateTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateTags]))] [System.Collections.Hashtable] # ARM resource tags ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -745,6 +806,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -766,10 +836,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.Confluent.private\Update-AzConfluentOrganization_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.Confluent.private\Update-AzConfluentOrganization_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.Confluent.private\Update-AzConfluentOrganization_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.Confluent.private\Update-AzConfluentOrganization_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -783,6 +853,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -845,7 +918,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. [Id ]: Resource identity path [OrganizationName ]: Organization resource name [ResourceGroupName ]: Resource group name @@ -957,6 +1030,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -979,9 +1061,7 @@ begin { Delete = 'Az.Confluent.custom\Remove-AzConfluentOrganization'; DeleteViaIdentity = 'Az.Confluent.custom\Remove-AzConfluentOrganization'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -995,6 +1075,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Confluent/Confluent.Autorest/exports/Remove-AzConfluentOrganization.ps1 b/generated/Confluent/Confluent.Autorest/exports/Remove-AzConfluentOrganization.ps1 index 86a7d94dcbc4..1c3a72fa16d3 100644 --- a/generated/Confluent/Confluent.Autorest/exports/Remove-AzConfluentOrganization.ps1 +++ b/generated/Confluent/Confluent.Autorest/exports/Remove-AzConfluentOrganization.ps1 @@ -33,7 +33,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. [Id ]: Resource identity path [OrganizationName ]: Organization resource name [ResourceGroupName ]: Resource group name @@ -145,6 +145,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -167,9 +176,7 @@ begin { Delete = 'Az.Confluent.custom\Remove-AzConfluentOrganization'; DeleteViaIdentity = 'Az.Confluent.custom\Remove-AzConfluentOrganization'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -183,6 +190,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Confluent/Confluent.Autorest/exports/Update-AzConfluentOrganization.ps1 b/generated/Confluent/Confluent.Autorest/exports/Update-AzConfluentOrganization.ps1 index 18647a712c4d..d0362a2cef78 100644 --- a/generated/Confluent/Confluent.Autorest/exports/Update-AzConfluentOrganization.ps1 +++ b/generated/Confluent/Confluent.Autorest/exports/Update-AzConfluentOrganization.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Update Organization resource +update Organization resource .Description -Update Organization resource +update Organization resource .Example Update-AzConfluentOrganization -ResourceGroupName azure-rg-test -Name confluentorg-02-pwsh -Tag @{"key01" = "value01"} .Example @@ -27,7 +27,7 @@ Get-AzConfluentOrganization -ResourceGroupName azure-rg-test -Name confluentorg- .Inputs Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource +Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource .Notes COMPLEX PARAMETER PROPERTIES @@ -42,10 +42,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.confluent/update-azconfluentorganization #> function Update-AzConfluentOrganization { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('OrganizationName')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Path')] [System.String] @@ -53,12 +55,16 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Path')] [System.String] # Resource group name ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -69,16 +75,28 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdateTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateTags]))] [System.Collections.Hashtable] # ARM resource tags ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -135,6 +153,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -156,10 +183,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.Confluent.private\Update-AzConfluentOrganization_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.Confluent.private\Update-AzConfluentOrganization_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.Confluent.private\Update-AzConfluentOrganization_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.Confluent.private\Update-AzConfluentOrganization_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -173,6 +200,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Confluent/Confluent.Autorest/generate-info.json b/generated/Confluent/Confluent.Autorest/generate-info.json index 204473c642a8..e12a131254f2 100644 --- a/generated/Confluent/Confluent.Autorest/generate-info.json +++ b/generated/Confluent/Confluent.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "4c003972-dd8b-4556-87ac-973a49f638fd" + "generate_Id": "9e1969f8-9c98-49c1-9f5b-482164d7261b" } diff --git a/generated/Confluent/Confluent.Autorest/generated/Module.cs b/generated/Confluent/Confluent.Autorest/generated/Module.cs index 237460eba6e1..eaced1577175 100644 --- a/generated/Confluent/Confluent.Autorest/generated/Module.cs +++ b/generated/Confluent/Confluent.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.Confluent.Module _instance; + /// the ISendAsync pipeline instance private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.HttpPipeline _pipeline; /// the ISendAsync pipeline instance (when proxy is enabled) private Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Module _instance; - /// the singleton of this module class - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module()); + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent"; @@ -125,9 +130,17 @@ public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.HttpPipeline CreateP /// 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/Confluent/Confluent.Autorest/generated/api/Confluent.cs b/generated/Confluent/Confluent.Autorest/generated/api/Confluent.cs index a08a6358c97f..dd33084f1b66 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Confluent.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Confluent.cs @@ -21,10 +21,11 @@ public partial class Confluent /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MarketplaceAgreementsCreate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsCreate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-03-01"; // Constant Parameters @@ -48,11 +49,11 @@ public partial class Confluent await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MarketplaceAgreementsCreate_Call(request,onOk,onDefault,eventListener,sender); + await this.MarketplaceAgreementsCreate_Call (request, onOk,onDefault,eventListener,sender); } } @@ -64,10 +65,11 @@ public partial class Confluent /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MarketplaceAgreementsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-03-01"; // Constant Parameters @@ -101,94 +103,119 @@ public partial class Confluent await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MarketplaceAgreementsCreate_Call(request,onOk,onDefault,eventListener,sender); + await this.MarketplaceAgreementsCreate_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). + /// Accept marketplace terms. + /// + /// Confluent Agreement resource /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync pipeline to use to make the 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 MarketplaceAgreementsCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsCreateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResource body, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2020-03-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ConfluentAgreementResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ResourceProviderDefaultErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Confluent/agreements/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Confluent/agreements/default'"); } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.Confluent/agreements/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MarketplaceAgreementsCreateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// + /// Accept marketplace terms. /// Microsoft Azure subscription id - /// Confluent Agreement resource + /// Json string supplied to the MarketplaceAgreementsCreate 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.Confluent.Runtime.ISendAsync pipeline to use to make the request. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MarketplaceAgreementsCreate_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResource body, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsCreateViaJsonString(string subscriptionId, 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.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) { + var apiVersion = @"2020-03-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - 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) + + "/providers/Microsoft.Confluent/agreements/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MarketplaceAgreementsCreate_Call (request, onOk,onDefault,eventListener,sender); } } - /// List Confluent marketplace agreements in the subscription. + /// Accept marketplace terms. /// Microsoft Azure subscription id - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Json string supplied to the MarketplaceAgreementsCreate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Confluent.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 MarketplaceAgreementsList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsCreateViaJsonStringWithResult(string subscriptionId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) { var apiVersion = @"2020-03-01"; // Constant Parameters @@ -198,73 +225,133 @@ public partial class Confluent var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.Confluent/agreements" + + "/providers/Microsoft.Confluent/agreements/default" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.MarketplaceAgreementsList_Call(request,onOk,onDefault,eventListener,sender); + return await this.MarketplaceAgreementsCreateWithResult_Call (request, eventListener,sender); } } - /// List Confluent marketplace agreements in the subscription. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Accept marketplace terms. + /// Microsoft Azure subscription id + /// Confluent Agreement resource /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync pipeline to use to make the 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 MarketplaceAgreementsListViaIdentity(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.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsCreateWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResource body, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-03-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Confluent/agreements$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Confluent/agreements'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId - + "/providers/Microsoft.Confluent/agreements" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Confluent/agreements/default" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.MarketplaceAgreementsList_Call(request,onOk,onDefault,eventListener,sender); + return await this.MarketplaceAgreementsCreateWithResult_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.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task MarketplaceAgreementsCreateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ConfluentAgreementResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ResourceProviderDefaultErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.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.Confluent.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 @@ -274,7 +361,7 @@ public partial class Confluent /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MarketplaceAgreementsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MarketplaceAgreementsCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -285,6 +372,7 @@ public partial class Confluent await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -292,13 +380,13 @@ public partial class Confluent case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ConfluentAgreementResourceListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ConfluentAgreementResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ResourceProviderDefaultErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ResourceProviderDefaultErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -314,27 +402,27 @@ public partial class Confluent } /// - /// 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. /// /// Microsoft Azure subscription id + /// Confluent Agreement 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 MarketplaceAgreementsList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task MarketplaceAgreementsCreate_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResource body, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Create Organization resource + /// List Confluent marketplace agreements in the subscription. /// Microsoft Azure subscription id - /// Resource group name - /// Organization resource name - /// Organization resource model /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -343,7 +431,7 @@ public partial class Confluent /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OrganizationCreate(string subscriptionId, string resourceGroupName, string organizationName, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) { var apiVersion = @"2020-03-01"; // Constant Parameters @@ -353,10 +441,7 @@ public partial class Confluent var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.Confluent/organizations/" - + global::System.Uri.EscapeDataString(organizationName) + + "/providers/Microsoft.Confluent/agreements" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -365,22 +450,17 @@ public partial class Confluent // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OrganizationCreate_Call(request,onOk,onDefault,eventListener,sender); + await this.MarketplaceAgreementsList_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create Organization resource + /// List Confluent marketplace agreements in the subscription. /// - /// Organization resource model /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -389,7 +469,7 @@ public partial class Confluent /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OrganizationCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsListViaIdentity(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.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) { var apiVersion = @"2020-03-01"; // Constant Parameters @@ -397,24 +477,19 @@ public partial class Confluent { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Confluent/organizations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Confluent/agreements$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Confluent/agreements'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var organizationName = _match.Groups["organizationName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.Confluent/organizations/" - + organizationName + + "/providers/Microsoft.Confluent/agreements" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -423,136 +498,1389 @@ public partial class Confluent // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OrganizationCreate_Call(request,onOk,onDefault,eventListener,sender); + await this.MarketplaceAgreementsList_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 Confluent marketplace agreements in the subscription. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Confluent.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 OrganizationCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) { + var apiVersion = @"2020-03-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.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/(?[^/]+)/providers/Microsoft.Confluent/agreements$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Confluent/agreements'"); + } - // 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.Confluent.Runtime.Method.Get); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.Confluent/agreements" + + "?" + + "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.Confluent.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.Confluent.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MarketplaceAgreementsListWithResult_Call (request, eventListener,sender); + } + } - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + /// List Confluent marketplace agreements in the subscription. + /// Microsoft Azure subscription id + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MarketplaceAgreementsListWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Confluent/agreements" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MarketplaceAgreementsListWithResult_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.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task MarketplaceAgreementsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Confluent.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. + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ConfluentAgreementResourceListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ResourceProviderDefaultErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.RestException(_response, await _result); + throw ex; } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.UndeclaredResponseException(_response); + else + { + throw new global::System.Exception($"[{code}] : {message}"); } } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task MarketplaceAgreementsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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: { - continue; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ConfluentAgreementResourceListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; } - // 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.Confluent.Runtime.Method.Get); + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ResourceProviderDefaultErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } - // drop the old response - _response?.Dispose(); + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Microsoft Azure subscription id + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task MarketplaceAgreementsList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } + } - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } + /// create Organization resource + /// Microsoft Azure subscription id + /// Resource group name + /// Organization resource name + /// Organization resource model + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OrganizationCreate(string subscriptionId, string resourceGroupName, string organizationName, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2020-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Confluent/organizations/" + + global::System.Uri.EscapeDataString(organizationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OrganizationCreate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// create Organization resource + /// + /// Organization resource model + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OrganizationCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2020-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Confluent/organizations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var organizationName = _match.Groups["organizationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Confluent/organizations/" + + organizationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OrganizationCreate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// create Organization resource + /// + /// Organization resource model + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OrganizationCreateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource body, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2020-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Confluent/organizations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var organizationName = _match.Groups["organizationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Confluent/organizations/" + + organizationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OrganizationCreateWithResult_Call (request, eventListener,sender); + } + } + + /// create Organization resource + /// Microsoft Azure subscription id + /// Resource group name + /// Organization resource name + /// Json string supplied to the OrganizationCreate 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.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OrganizationCreateViaJsonString(string subscriptionId, string resourceGroupName, string organizationName, 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.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Confluent/organizations/" + + global::System.Uri.EscapeDataString(organizationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OrganizationCreate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// create Organization resource + /// Microsoft Azure subscription id + /// Resource group name + /// Organization resource name + /// Json string supplied to the OrganizationCreate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OrganizationCreateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string organizationName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Confluent/organizations/" + + global::System.Uri.EscapeDataString(organizationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OrganizationCreateWithResult_Call (request, eventListener,sender); + } + } + + /// create Organization resource + /// Microsoft Azure subscription id + /// Resource group name + /// Organization resource name + /// Organization resource model + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OrganizationCreateWithResult(string subscriptionId, string resourceGroupName, string organizationName, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource body, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2020-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Confluent/organizations/" + + global::System.Uri.EscapeDataString(organizationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OrganizationCreateWithResult_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.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OrganizationCreateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.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.Confluent.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.Confluent.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.Confluent.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.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.Confluent.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.Confluent.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ResourceProviderDefaultErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.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.Confluent.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.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OrganizationCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.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.Confluent.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.Confluent.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.Confluent.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.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.Confluent.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.Confluent.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ResourceProviderDefaultErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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. + /// + /// Microsoft Azure subscription id + /// Resource group name + /// Organization resource name + /// Organization resource model + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OrganizationCreate_Validate(string subscriptionId, string resourceGroupName, string organizationName, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource body, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(organizationName),organizationName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete Organization resource + /// Microsoft Azure subscription id + /// Resource group name + /// Organization resource name + /// 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.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OrganizationDelete(string subscriptionId, string resourceGroupName, string organizationName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Confluent/organizations/" + + global::System.Uri.EscapeDataString(organizationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OrganizationDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete Organization 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.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OrganizationDeleteViaIdentity(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.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Confluent/organizations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var organizationName = _match.Groups["organizationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Confluent/organizations/" + + organizationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OrganizationDelete_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.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OrganizationDelete_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.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.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.Confluent.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.Confluent.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.Confluent.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.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.Confluent.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.Confluent.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.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.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ResourceProviderDefaultErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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. + /// + /// Microsoft Azure subscription id + /// Resource group name + /// Organization resource name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OrganizationDelete_Validate(string subscriptionId, string resourceGroupName, string organizationName, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(organizationName),organizationName); + } + } + + /// Get the properties of a specific Organization resource. + /// Microsoft Azure subscription id + /// Resource group name + /// Organization resource 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.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OrganizationGet(string subscriptionId, string resourceGroupName, string organizationName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Confluent/organizations/" + + global::System.Uri.EscapeDataString(organizationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OrganizationGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get the properties of a specific Organization 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.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OrganizationGetViaIdentity(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.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Confluent/organizations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var organizationName = _match.Groups["organizationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Confluent/organizations/" + + organizationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OrganizationGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get the properties of a specific Organization resource. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OrganizationGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Confluent/organizations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var organizationName = _match.Groups["organizationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Confluent/organizations/" + + organizationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OrganizationGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get the properties of a specific Organization resource. + /// Microsoft Azure subscription id + /// Resource group name + /// Organization resource name + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OrganizationGetWithResult(string subscriptionId, string resourceGroupName, string organizationName, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Confluent/organizations/" + + global::System.Uri.EscapeDataString(organizationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OrganizationGetWithResult_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.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OrganizationGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ResourceProviderDefaultErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.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.Confluent.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.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OrganizationGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -560,13 +1888,13 @@ public partial class Confluent case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ResourceProviderDefaultErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ResourceProviderDefaultErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -582,35 +1910,30 @@ public partial class Confluent } /// - /// 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. /// /// Microsoft Azure subscription id /// Resource group name /// Organization resource name - /// Organization resource model /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task OrganizationCreate_Validate(string subscriptionId, string resourceGroupName, string organizationName, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource body, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task OrganizationGet_Validate(string subscriptionId, string resourceGroupName, string organizationName, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertNotNull(nameof(organizationName),organizationName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Delete Organization resource + /// List all Organizations under the specified resource group. /// Microsoft Azure subscription id /// Resource group name - /// Organization resource name /// 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. @@ -618,7 +1941,7 @@ public partial class Confluent /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OrganizationDelete(string subscriptionId, string resourceGroupName, string organizationName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OrganizationListByResourceGroup(string subscriptionId, string resourceGroupName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) { var apiVersion = @"2020-03-01"; // Constant Parameters @@ -630,8 +1953,7 @@ public partial class Confluent + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.Confluent/organizations/" - + global::System.Uri.EscapeDataString(organizationName) + + "/providers/Microsoft.Confluent/organizations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -640,19 +1962,18 @@ public partial class Confluent // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OrganizationDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.OrganizationListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete Organization resource + /// List all Organizations under the specified resource group. /// /// 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. @@ -660,7 +1981,7 @@ public partial class Confluent /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OrganizationDeleteViaIdentity(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.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OrganizationListByResourceGroupViaIdentity(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.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) { var apiVersion = @"2020-03-01"; // Constant Parameters @@ -668,24 +1989,22 @@ public partial class Confluent { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Confluent/organizations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Confluent/organizations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var organizationName = _match.Groups["organizationName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.Confluent/organizations/" - + organizationName + + "/providers/Microsoft.Confluent/organizations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -694,134 +2013,187 @@ public partial class Confluent // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OrganizationDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.OrganizationListByResourceGroup_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). + /// List all Organizations under the specified resource group. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Confluent.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 OrganizationDelete_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.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OrganizationListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) { + var apiVersion = @"2020-03-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Confluent/organizations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations'"); + } - // 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.Confluent.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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Confluent/organizations" + + "?" + + "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.Confluent.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.Confluent.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.Confluent.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OrganizationListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } + /// List all Organizations under the specified resource group. + /// Microsoft Azure subscription id + /// Resource group name + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OrganizationListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Confluent/organizations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OrganizationListByResourceGroupWithResult_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.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OrganizationListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.UndeclaredResponseException(_response); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ResourceProviderDefaultErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.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.Confluent.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.Confluent.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OrganizationListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -829,19 +2201,13 @@ public partial class Confluent case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ResourceProviderDefaultErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ResourceProviderDefaultErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -857,30 +2223,26 @@ public partial class Confluent } /// - /// 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. /// /// Microsoft Azure subscription id /// Resource group name - /// Organization resource name /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task OrganizationDelete_Validate(string subscriptionId, string resourceGroupName, string organizationName, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task OrganizationListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertNotNull(nameof(organizationName),organizationName); } } - /// Get the properties of a specific Organization resource. + /// List all organizations under the specified subscription. /// Microsoft Azure subscription id - /// Resource group name - /// Organization resource 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). @@ -889,20 +2251,65 @@ public partial class Confluent /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OrganizationGet(string subscriptionId, string resourceGroupName, string organizationName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OrganizationListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Confluent/organizations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OrganizationListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List all organizations under the specified subscription. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OrganizationListBySubscriptionViaIdentity(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.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) { var apiVersion = @"2020-03-01"; // Constant Parameters using( NoSynchronizationContext ) { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Confluent/organizations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Confluent/organizations'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.Confluent/organizations/" - + global::System.Uri.EscapeDataString(organizationName) + + subscriptionId + + "/providers/Microsoft.Confluent/organizations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -916,21 +2323,19 @@ public partial class Confluent await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OrganizationGet_Call(request,onOk,onDefault,eventListener,sender); + await this.OrganizationListBySubscription_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get the properties of a specific Organization resource. + /// List all organizations under the specified subscription. /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Confluent.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 OrganizationGetViaIdentity(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.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OrganizationListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) { var apiVersion = @"2020-03-01"; // Constant Parameters @@ -938,42 +2343,135 @@ public partial class Confluent { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Confluent/organizations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Confluent/organizations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Confluent/organizations'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var organizationName = _match.Groups["organizationName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.Confluent/organizations/" - + organizationName + + "/providers/Microsoft.Confluent/organizations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OrganizationListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// List all organizations under the specified subscription. + /// Microsoft Azure subscription id + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OrganizationListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Confluent/organizations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.OrganizationGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.OrganizationListBySubscriptionWithResult_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.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OrganizationListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ResourceProviderDefaultErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.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.Confluent.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 @@ -983,7 +2481,7 @@ public partial class Confluent /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task OrganizationGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task OrganizationListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -994,6 +2492,7 @@ public partial class Confluent await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1001,13 +2500,13 @@ public partial class Confluent case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ResourceProviderDefaultErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ResourceProviderDefaultErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1023,29 +2522,23 @@ public partial class Confluent } /// - /// 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. /// /// Microsoft Azure subscription id - /// Resource group name - /// Organization resource name /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task OrganizationGet_Validate(string subscriptionId, string resourceGroupName, string organizationName, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task OrganizationListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertNotNull(nameof(organizationName),organizationName); } } - /// List all Organizations under the specified resource group. - /// Microsoft Azure subscription id - /// Resource group name + /// List all operations provided by Microsoft.Confluent. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -1054,7 +2547,7 @@ public partial class Confluent /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OrganizationListByResourceGroup(string subscriptionId, string resourceGroupName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OrganizationOperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) { var apiVersion = @"2020-03-01"; // Constant Parameters @@ -1062,11 +2555,7 @@ public partial class Confluent { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.Confluent/organizations" + "/providers/Microsoft.Confluent/operations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1080,11 +2569,11 @@ public partial class Confluent await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OrganizationListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.OrganizationOperationsList_Call (request, onOk,onDefault,eventListener,sender); } } - /// List all Organizations under the specified resource group. + /// List all operations provided by Microsoft.Confluent. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -1094,7 +2583,7 @@ public partial class Confluent /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OrganizationListByResourceGroupViaIdentity(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.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OrganizationOperationsListViaIdentity(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.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) { var apiVersion = @"2020-03-01"; // Constant Parameters @@ -1102,22 +2591,16 @@ public partial class Confluent { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Confluent/organizations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Confluent/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations'"); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Confluent/operations'"); } // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.Confluent/organizations" + "/providers/Microsoft.Confluent/operations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1131,89 +2614,61 @@ public partial class Confluent await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OrganizationListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.OrganizationOperationsList_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 all operations provided by Microsoft.Confluent. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Confluent.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 OrganizationListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OrganizationOperationsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) { + var apiVersion = @"2020-03-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ResourceProviderDefaultErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Confluent/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Confluent/operations'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// - /// Microsoft Azure subscription id - /// Resource group name - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task OrganizationListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Confluent/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OrganizationOperationsListWithResult_Call (request, eventListener,sender); } } - /// List all organizations under the specified subscription. - /// Microsoft Azure subscription id - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// List all operations provided by Microsoft.Confluent. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Confluent.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 OrganizationListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OrganizationOperationsListWithResult(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) { var apiVersion = @"2020-03-01"; // Constant Parameters @@ -1221,75 +2676,87 @@ public partial class Confluent { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.Confluent/organizations" + "/providers/Microsoft.Confluent/operations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.OrganizationListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + return await this.OrganizationOperationsListWithResult_Call (request, eventListener,sender); } } - /// List all organizations under the specified subscription. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Confluent.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 OrganizationListBySubscriptionViaIdentity(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.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task OrganizationOperationsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) { - var apiVersion = @"2020-03-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Confluent/organizations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ResourceProviderDefaultErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Confluent/organizations'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/providers/Microsoft.Confluent/organizations" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.OrganizationListBySubscription_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 @@ -1299,7 +2766,7 @@ public partial class Confluent /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task OrganizationListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task OrganizationOperationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1310,6 +2777,7 @@ public partial class Confluent await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1317,13 +2785,13 @@ public partial class Confluent case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ResourceProviderDefaultErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ResourceProviderDefaultErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1339,32 +2807,36 @@ public partial class Confluent } /// - /// 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. /// - /// Microsoft Azure subscription id /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task OrganizationListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task OrganizationOperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } } - /// List all operations provided by Microsoft.Confluent. + /// update Organization resource + /// Microsoft Azure subscription id + /// Resource group name + /// Organization resource name + /// Updated Organization 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.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OrganizationOperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OrganizationUpdate(string subscriptionId, string resourceGroupName, string organizationName, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-03-01"; // Constant Parameters @@ -1372,7 +2844,12 @@ public partial class Confluent { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.Confluent/operations" + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Confluent/organizations/" + + global::System.Uri.EscapeDataString(organizationName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1381,26 +2858,32 @@ public partial class Confluent // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OrganizationOperationsList_Call(request,onOk,onDefault,eventListener,sender); + await this.OrganizationUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// List all operations provided by Microsoft.Confluent. + /// update Organization resource /// + /// Updated Organization 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.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OrganizationOperationsListViaIdentity(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.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OrganizationUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-03-01"; // Constant Parameters @@ -1408,16 +2891,24 @@ public partial class Confluent { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Confluent/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Confluent/organizations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Confluent/operations'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}'"); } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var organizationName = _match.Groups["organizationName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.Confluent/operations" + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Confluent/organizations/" + + organizationName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1426,85 +2917,81 @@ public partial class Confluent // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OrganizationOperationsList_Call(request,onOk,onDefault,eventListener,sender); + await this.OrganizationUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update Organization resource + /// + /// Updated Organization resource /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync pipeline to use to make the 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 OrganizationOperationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OrganizationUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdate body, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2020-03-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ResourceProviderDefaultErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Confluent/organizations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. - /// - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task OrganizationOperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var organizationName = _match.Groups["organizationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Confluent/organizations/" + + organizationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OrganizationUpdateWithResult_Call (request, eventListener,sender); } } - /// Update Organization resource + /// update Organization resource /// Microsoft Azure subscription id /// Resource group name /// Organization resource name - /// Updated Organization resource + /// Json string supplied to the OrganizationUpdate 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). @@ -1513,7 +3000,7 @@ public partial class Confluent /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OrganizationUpdate(string subscriptionId, string resourceGroupName, string organizationName, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OrganizationUpdateViaJsonString(string subscriptionId, string resourceGroupName, string organizationName, 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.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) { var apiVersion = @"2020-03-01"; // Constant Parameters @@ -1540,73 +3027,168 @@ public partial class Confluent await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OrganizationUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.OrganizationUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Update Organization resource - /// - /// Updated Organization 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). + /// update Organization resource + /// Microsoft Azure subscription id + /// Resource group name + /// Organization resource name + /// Json string supplied to the OrganizationUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Confluent.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 OrganizationUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OrganizationUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string organizationName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) { var apiVersion = @"2020-03-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Confluent/organizations/" + + global::System.Uri.EscapeDataString(organizationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Confluent/organizations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}'"); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var organizationName = _match.Groups["organizationName"].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.Confluent.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OrganizationUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update Organization resource + /// Microsoft Azure subscription id + /// Resource group name + /// Organization resource name + /// Updated Organization resource + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OrganizationUpdateWithResult(string subscriptionId, string resourceGroupName, string organizationName, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdate body, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2020-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName + + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.Confluent/organizations/" - + organizationName + + global::System.Uri.EscapeDataString(organizationName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.OrganizationUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.OrganizationUpdateWithResult_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.Confluent.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OrganizationUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ResourceProviderDefaultErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.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.Confluent.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 @@ -1616,7 +3198,7 @@ public partial class Confluent /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task OrganizationUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task OrganizationUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1627,6 +3209,7 @@ public partial class Confluent await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1634,13 +3217,13 @@ public partial class Confluent case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ResourceProviderDefaultErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ResourceProviderDefaultErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1667,7 +3250,7 @@ public partial class Confluent /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task OrganizationUpdate_Validate(string subscriptionId, string resourceGroupName, string organizationName, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdate body, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task OrganizationUpdate_Validate(string subscriptionId, string resourceGroupName, string organizationName, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdate body, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResource.PowerShell.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResource.PowerShell.cs deleted file mode 100644 index fcc787c1084b..000000000000 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResource.PowerShell.cs +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; - - /// Organization resource. - [System.ComponentModel.TypeConverter(typeof(OrganizationResourceTypeConverter))] - public partial class OrganizationResource - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should 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.Confluent.Models.Api20200301.IOrganizationResource DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new OrganizationResource(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new OrganizationResource(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal OrganizationResource(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.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourcePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("OfferDetail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetail) content.GetValueForProperty("OfferDetail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetail, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OfferDetailTypeConverter.ConvertFrom); - } - if (content.Contains("UserDetail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).UserDetail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetail) content.GetValueForProperty("UserDetail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).UserDetail, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.UserDetailTypeConverter.ConvertFrom); - } - if (content.Contains("CreatedTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).CreatedTime = (global::System.DateTime?) content.GetValueForProperty("CreatedTime",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).CreatedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState.CreateFrom); - } - if (content.Contains("OrganizationId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OrganizationId = (string) content.GetValueForProperty("OrganizationId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OrganizationId, global::System.Convert.ToString); - } - if (content.Contains("SsoUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).SsoUrl = (string) content.GetValueForProperty("SsoUrl",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).SsoUrl, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailPublisherId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetailPublisherId = (string) content.GetValueForProperty("OfferDetailPublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetailPublisherId, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetailId = (string) content.GetValueForProperty("OfferDetailId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetailId, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailPlanId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetailPlanId = (string) content.GetValueForProperty("OfferDetailPlanId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetailPlanId, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailPlanName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetailPlanName = (string) content.GetValueForProperty("OfferDetailPlanName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetailPlanName, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailTermUnit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetailTermUnit = (string) content.GetValueForProperty("OfferDetailTermUnit",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetailTermUnit, global::System.Convert.ToString); - } - if (content.Contains("UserDetailFirstName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).UserDetailFirstName = (string) content.GetValueForProperty("UserDetailFirstName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).UserDetailFirstName, global::System.Convert.ToString); - } - if (content.Contains("UserDetailLastName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).UserDetailLastName = (string) content.GetValueForProperty("UserDetailLastName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).UserDetailLastName, global::System.Convert.ToString); - } - if (content.Contains("UserDetailEmailAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).UserDetailEmailAddress = (string) content.GetValueForProperty("UserDetailEmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).UserDetailEmailAddress, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetailStatus = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus?) content.GetValueForProperty("OfferDetailStatus",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetailStatus, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus.CreateFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal OrganizationResource(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.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourcePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("OfferDetail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetail) content.GetValueForProperty("OfferDetail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetail, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OfferDetailTypeConverter.ConvertFrom); - } - if (content.Contains("UserDetail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).UserDetail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetail) content.GetValueForProperty("UserDetail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).UserDetail, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.UserDetailTypeConverter.ConvertFrom); - } - if (content.Contains("CreatedTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).CreatedTime = (global::System.DateTime?) content.GetValueForProperty("CreatedTime",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).CreatedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState.CreateFrom); - } - if (content.Contains("OrganizationId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OrganizationId = (string) content.GetValueForProperty("OrganizationId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OrganizationId, global::System.Convert.ToString); - } - if (content.Contains("SsoUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).SsoUrl = (string) content.GetValueForProperty("SsoUrl",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).SsoUrl, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailPublisherId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetailPublisherId = (string) content.GetValueForProperty("OfferDetailPublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetailPublisherId, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetailId = (string) content.GetValueForProperty("OfferDetailId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetailId, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailPlanId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetailPlanId = (string) content.GetValueForProperty("OfferDetailPlanId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetailPlanId, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailPlanName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetailPlanName = (string) content.GetValueForProperty("OfferDetailPlanName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetailPlanName, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailTermUnit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetailTermUnit = (string) content.GetValueForProperty("OfferDetailTermUnit",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetailTermUnit, global::System.Convert.ToString); - } - if (content.Contains("UserDetailFirstName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).UserDetailFirstName = (string) content.GetValueForProperty("UserDetailFirstName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).UserDetailFirstName, global::System.Convert.ToString); - } - if (content.Contains("UserDetailLastName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).UserDetailLastName = (string) content.GetValueForProperty("UserDetailLastName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).UserDetailLastName, global::System.Convert.ToString); - } - if (content.Contains("UserDetailEmailAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).UserDetailEmailAddress = (string) content.GetValueForProperty("UserDetailEmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).UserDetailEmailAddress, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetailStatus = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus?) content.GetValueForProperty("OfferDetailStatus",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal)this).OfferDetailStatus, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus.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.Confluent.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Organization resource. - [System.ComponentModel.TypeConverter(typeof(OrganizationResourceTypeConverter))] - public partial interface IOrganizationResource - - { - - } -} \ No newline at end of file diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceProperties.PowerShell.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceProperties.PowerShell.cs deleted file mode 100644 index 22f55f320bf9..000000000000 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceProperties.PowerShell.cs +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; - - /// Organization resource property - [System.ComponentModel.TypeConverter(typeof(OrganizationResourcePropertiesTypeConverter))] - public partial class OrganizationResourceProperties - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should 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.Confluent.Models.Api20200301.IOrganizationResourceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new OrganizationResourceProperties(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new OrganizationResourceProperties(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal OrganizationResourceProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("OfferDetail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetail) content.GetValueForProperty("OfferDetail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetail, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OfferDetailTypeConverter.ConvertFrom); - } - if (content.Contains("UserDetail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetail) content.GetValueForProperty("UserDetail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetail, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.UserDetailTypeConverter.ConvertFrom); - } - if (content.Contains("CreatedTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).CreatedTime = (global::System.DateTime?) content.GetValueForProperty("CreatedTime",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).CreatedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState.CreateFrom); - } - if (content.Contains("OrganizationId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OrganizationId = (string) content.GetValueForProperty("OrganizationId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OrganizationId, global::System.Convert.ToString); - } - if (content.Contains("SsoUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).SsoUrl = (string) content.GetValueForProperty("SsoUrl",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).SsoUrl, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailPublisherId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailPublisherId = (string) content.GetValueForProperty("OfferDetailPublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailPublisherId, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailId = (string) content.GetValueForProperty("OfferDetailId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailId, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailPlanId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailPlanId = (string) content.GetValueForProperty("OfferDetailPlanId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailPlanId, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailPlanName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailPlanName = (string) content.GetValueForProperty("OfferDetailPlanName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailPlanName, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailTermUnit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailTermUnit = (string) content.GetValueForProperty("OfferDetailTermUnit",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailTermUnit, global::System.Convert.ToString); - } - if (content.Contains("UserDetailFirstName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetailFirstName = (string) content.GetValueForProperty("UserDetailFirstName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetailFirstName, global::System.Convert.ToString); - } - if (content.Contains("UserDetailLastName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetailLastName = (string) content.GetValueForProperty("UserDetailLastName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetailLastName, global::System.Convert.ToString); - } - if (content.Contains("UserDetailEmailAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetailEmailAddress = (string) content.GetValueForProperty("UserDetailEmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetailEmailAddress, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailStatus = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus?) content.GetValueForProperty("OfferDetailStatus",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailStatus, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus.CreateFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal OrganizationResourceProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("OfferDetail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetail) content.GetValueForProperty("OfferDetail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetail, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OfferDetailTypeConverter.ConvertFrom); - } - if (content.Contains("UserDetail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetail) content.GetValueForProperty("UserDetail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetail, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.UserDetailTypeConverter.ConvertFrom); - } - if (content.Contains("CreatedTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).CreatedTime = (global::System.DateTime?) content.GetValueForProperty("CreatedTime",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).CreatedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState.CreateFrom); - } - if (content.Contains("OrganizationId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OrganizationId = (string) content.GetValueForProperty("OrganizationId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OrganizationId, global::System.Convert.ToString); - } - if (content.Contains("SsoUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).SsoUrl = (string) content.GetValueForProperty("SsoUrl",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).SsoUrl, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailPublisherId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailPublisherId = (string) content.GetValueForProperty("OfferDetailPublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailPublisherId, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailId = (string) content.GetValueForProperty("OfferDetailId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailId, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailPlanId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailPlanId = (string) content.GetValueForProperty("OfferDetailPlanId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailPlanId, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailPlanName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailPlanName = (string) content.GetValueForProperty("OfferDetailPlanName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailPlanName, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailTermUnit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailTermUnit = (string) content.GetValueForProperty("OfferDetailTermUnit",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailTermUnit, global::System.Convert.ToString); - } - if (content.Contains("UserDetailFirstName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetailFirstName = (string) content.GetValueForProperty("UserDetailFirstName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetailFirstName, global::System.Convert.ToString); - } - if (content.Contains("UserDetailLastName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetailLastName = (string) content.GetValueForProperty("UserDetailLastName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetailLastName, global::System.Convert.ToString); - } - if (content.Contains("UserDetailEmailAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetailEmailAddress = (string) content.GetValueForProperty("UserDetailEmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetailEmailAddress, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailStatus = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus?) content.GetValueForProperty("OfferDetailStatus",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailStatus, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus.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.Confluent.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Organization resource property - [System.ComponentModel.TypeConverter(typeof(OrganizationResourcePropertiesTypeConverter))] - public partial interface IOrganizationResourceProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesAutoGenerated.PowerShell.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesAutoGenerated.PowerShell.cs deleted file mode 100644 index 925afc18edee..000000000000 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesAutoGenerated.PowerShell.cs +++ /dev/null @@ -1,261 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; - - /// Organization resource properties - [System.ComponentModel.TypeConverter(typeof(OrganizationResourcePropertiesAutoGeneratedTypeConverter))] - public partial class OrganizationResourcePropertiesAutoGenerated - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should 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.Confluent.Models.Api20200301.IOrganizationResourcePropertiesAutoGenerated DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new OrganizationResourcePropertiesAutoGenerated(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesAutoGenerated DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new OrganizationResourcePropertiesAutoGenerated(content); - } - - /// - /// Creates a new instance of , deserializing the content from a - /// json string. - /// - /// a string containing a JSON serialized instance of this model. - /// - /// an instance of the model class. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesAutoGenerated FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal OrganizationResourcePropertiesAutoGenerated(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("OfferDetailPublisherId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailPublisherId = (string) content.GetValueForProperty("OfferDetailPublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailPublisherId, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailId = (string) content.GetValueForProperty("OfferDetailId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailId, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailPlanId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailPlanId = (string) content.GetValueForProperty("OfferDetailPlanId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailPlanId, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailPlanName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailPlanName = (string) content.GetValueForProperty("OfferDetailPlanName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailPlanName, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailTermUnit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailTermUnit = (string) content.GetValueForProperty("OfferDetailTermUnit",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailTermUnit, global::System.Convert.ToString); - } - if (content.Contains("UserDetailFirstName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetailFirstName = (string) content.GetValueForProperty("UserDetailFirstName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetailFirstName, global::System.Convert.ToString); - } - if (content.Contains("UserDetailLastName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetailLastName = (string) content.GetValueForProperty("UserDetailLastName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetailLastName, global::System.Convert.ToString); - } - if (content.Contains("UserDetailEmailAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetailEmailAddress = (string) content.GetValueForProperty("UserDetailEmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetailEmailAddress, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailStatus = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus?) content.GetValueForProperty("OfferDetailStatus",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailStatus, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus.CreateFrom); - } - if (content.Contains("OfferDetail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetail) content.GetValueForProperty("OfferDetail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetail, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OfferDetailTypeConverter.ConvertFrom); - } - if (content.Contains("UserDetail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetail) content.GetValueForProperty("UserDetail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetail, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.UserDetailTypeConverter.ConvertFrom); - } - if (content.Contains("CreatedTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).CreatedTime = (global::System.DateTime?) content.GetValueForProperty("CreatedTime",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).CreatedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState.CreateFrom); - } - if (content.Contains("OrganizationId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OrganizationId = (string) content.GetValueForProperty("OrganizationId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OrganizationId, global::System.Convert.ToString); - } - if (content.Contains("SsoUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).SsoUrl = (string) content.GetValueForProperty("SsoUrl",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).SsoUrl, global::System.Convert.ToString); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal OrganizationResourcePropertiesAutoGenerated(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("OfferDetailPublisherId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailPublisherId = (string) content.GetValueForProperty("OfferDetailPublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailPublisherId, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailId = (string) content.GetValueForProperty("OfferDetailId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailId, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailPlanId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailPlanId = (string) content.GetValueForProperty("OfferDetailPlanId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailPlanId, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailPlanName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailPlanName = (string) content.GetValueForProperty("OfferDetailPlanName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailPlanName, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailTermUnit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailTermUnit = (string) content.GetValueForProperty("OfferDetailTermUnit",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailTermUnit, global::System.Convert.ToString); - } - if (content.Contains("UserDetailFirstName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetailFirstName = (string) content.GetValueForProperty("UserDetailFirstName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetailFirstName, global::System.Convert.ToString); - } - if (content.Contains("UserDetailLastName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetailLastName = (string) content.GetValueForProperty("UserDetailLastName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetailLastName, global::System.Convert.ToString); - } - if (content.Contains("UserDetailEmailAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetailEmailAddress = (string) content.GetValueForProperty("UserDetailEmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetailEmailAddress, global::System.Convert.ToString); - } - if (content.Contains("OfferDetailStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailStatus = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus?) content.GetValueForProperty("OfferDetailStatus",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetailStatus, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus.CreateFrom); - } - if (content.Contains("OfferDetail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetail) content.GetValueForProperty("OfferDetail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OfferDetail, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OfferDetailTypeConverter.ConvertFrom); - } - if (content.Contains("UserDetail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetail) content.GetValueForProperty("UserDetail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).UserDetail, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.UserDetailTypeConverter.ConvertFrom); - } - if (content.Contains("CreatedTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).CreatedTime = (global::System.DateTime?) content.GetValueForProperty("CreatedTime",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).CreatedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState.CreateFrom); - } - if (content.Contains("OrganizationId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OrganizationId = (string) content.GetValueForProperty("OrganizationId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).OrganizationId, global::System.Convert.ToString); - } - if (content.Contains("SsoUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).SsoUrl = (string) content.GetValueForProperty("SsoUrl",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)this).SsoUrl, 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.Confluent.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Organization resource properties - [System.ComponentModel.TypeConverter(typeof(OrganizationResourcePropertiesAutoGeneratedTypeConverter))] - public partial interface IOrganizationResourcePropertiesAutoGenerated - - { - - } -} \ No newline at end of file diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesAutoGenerated.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesAutoGenerated.cs deleted file mode 100644 index 6cb4fc8b3182..000000000000 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesAutoGenerated.cs +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; - - /// Organization resource properties - public partial class OrganizationResourcePropertiesAutoGenerated : - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesAutoGenerated, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesAutoGeneratedInternal, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceProperties __organizationResourceProperties = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceProperties(); - - /// The creation time of the resource. - [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] - public global::System.DateTime? CreatedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).CreatedTime; } - - /// Internal Acessors for CreatedTime - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal.CreatedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).CreatedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).CreatedTime = value; } - - /// Internal Acessors for OfferDetailStatus - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal.OfferDetailStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).OfferDetailStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).OfferDetailStatus = value; } - - /// Internal Acessors for OrganizationId - string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal.OrganizationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).OrganizationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).OrganizationId = value; } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).ProvisioningState = value; } - - /// Internal Acessors for SsoUrl - string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal.SsoUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).SsoUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).SsoUrl = value; } - - /// Confluent offer detail - [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetail OfferDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).OfferDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).OfferDetail = value ?? null /* model class */; } - - /// Offer Id - [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] - public string OfferDetailId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).OfferDetailId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).OfferDetailId = value ?? null; } - - /// Offer Plan Id - [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] - public string OfferDetailPlanId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).OfferDetailPlanId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).OfferDetailPlanId = value ?? null; } - - /// Offer Plan Name - [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] - public string OfferDetailPlanName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).OfferDetailPlanName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).OfferDetailPlanName = value ?? null; } - - /// Publisher Id - [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] - public string OfferDetailPublisherId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).OfferDetailPublisherId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).OfferDetailPublisherId = value ?? null; } - - /// SaaS Offer Status - [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus? OfferDetailStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).OfferDetailStatus; } - - /// Offer Plan Term unit - [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] - public string OfferDetailTermUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).OfferDetailTermUnit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).OfferDetailTermUnit = value ?? null; } - - /// Id of the Confluent organization. - [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] - public string OrganizationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).OrganizationId; } - - /// Provision states for confluent RP - [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).ProvisioningState; } - - /// SSO url for the Confluent organization. - [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] - public string SsoUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).SsoUrl; } - - /// Subscriber detail - [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetail UserDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).UserDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).UserDetail = value ?? null /* model class */; } - - /// Email address - [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] - public string UserDetailEmailAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).UserDetailEmailAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).UserDetailEmailAddress = value ?? null; } - - /// First name - [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] - public string UserDetailFirstName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).UserDetailFirstName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).UserDetailFirstName = value ?? null; } - - /// Last name - [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] - public string UserDetailLastName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).UserDetailLastName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)__organizationResourceProperties).UserDetailLastName = value ?? null; } - - /// - /// Creates an new instance. - /// - public OrganizationResourcePropertiesAutoGenerated() - { - - } - - /// 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.Confluent.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__organizationResourceProperties), __organizationResourceProperties); - await eventListener.AssertObjectIsValid(nameof(__organizationResourceProperties), __organizationResourceProperties); - } - } - /// Organization resource properties - public partial interface IOrganizationResourcePropertiesAutoGenerated : - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceProperties - { - - } - /// Organization resource properties - internal partial interface IOrganizationResourcePropertiesAutoGeneratedInternal : - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal - { - - } -} \ No newline at end of file diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementProperties.PowerShell.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementProperties.PowerShell.cs similarity index 60% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementProperties.PowerShell.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementProperties.PowerShell.cs index 7f6cc162fddc..948470a2fea4 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementProperties.PowerShell.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class ConfluentAgreementProperties 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,41 +78,41 @@ internal ConfluentAgreementProperties(global::System.Collections.IDictionary con // actually deserialize if (content.Contains("Publisher")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).Publisher, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).Publisher, global::System.Convert.ToString); } if (content.Contains("Product")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).Product, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).Product, global::System.Convert.ToString); } if (content.Contains("Plan")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).Plan = (string) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).Plan, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).Plan = (string) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).Plan, global::System.Convert.ToString); } if (content.Contains("LicenseTextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).LicenseTextLink = (string) content.GetValueForProperty("LicenseTextLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).LicenseTextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).LicenseTextLink = (string) content.GetValueForProperty("LicenseTextLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).LicenseTextLink, global::System.Convert.ToString); } if (content.Contains("PrivacyPolicyLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).PrivacyPolicyLink = (string) content.GetValueForProperty("PrivacyPolicyLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).PrivacyPolicyLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).PrivacyPolicyLink = (string) content.GetValueForProperty("PrivacyPolicyLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).PrivacyPolicyLink, global::System.Convert.ToString); } if (content.Contains("RetrieveDatetime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).RetrieveDatetime = (global::System.DateTime?) content.GetValueForProperty("RetrieveDatetime",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).RetrieveDatetime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).RetrieveDatetime = (global::System.DateTime?) content.GetValueForProperty("RetrieveDatetime",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).RetrieveDatetime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Signature")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).Signature = (string) content.GetValueForProperty("Signature",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).Signature, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).Signature = (string) content.GetValueForProperty("Signature",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).Signature, global::System.Convert.ToString); } if (content.Contains("Accepted")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).Accepted = (bool?) content.GetValueForProperty("Accepted",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).Accepted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).Accepted = (bool?) content.GetValueForProperty("Accepted",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).Accepted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -119,63 +127,61 @@ internal ConfluentAgreementProperties(global::System.Management.Automation.PSObj // actually deserialize if (content.Contains("Publisher")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).Publisher, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).Publisher, global::System.Convert.ToString); } if (content.Contains("Product")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).Product, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).Product, global::System.Convert.ToString); } if (content.Contains("Plan")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).Plan = (string) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).Plan, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).Plan = (string) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).Plan, global::System.Convert.ToString); } if (content.Contains("LicenseTextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).LicenseTextLink = (string) content.GetValueForProperty("LicenseTextLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).LicenseTextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).LicenseTextLink = (string) content.GetValueForProperty("LicenseTextLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).LicenseTextLink, global::System.Convert.ToString); } if (content.Contains("PrivacyPolicyLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).PrivacyPolicyLink = (string) content.GetValueForProperty("PrivacyPolicyLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).PrivacyPolicyLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).PrivacyPolicyLink = (string) content.GetValueForProperty("PrivacyPolicyLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).PrivacyPolicyLink, global::System.Convert.ToString); } if (content.Contains("RetrieveDatetime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).RetrieveDatetime = (global::System.DateTime?) content.GetValueForProperty("RetrieveDatetime",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).RetrieveDatetime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).RetrieveDatetime = (global::System.DateTime?) content.GetValueForProperty("RetrieveDatetime",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).RetrieveDatetime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Signature")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).Signature = (string) content.GetValueForProperty("Signature",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).Signature, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).Signature = (string) content.GetValueForProperty("Signature",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).Signature, global::System.Convert.ToString); } if (content.Contains("Accepted")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).Accepted = (bool?) content.GetValueForProperty("Accepted",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)this).Accepted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).Accepted = (bool?) content.GetValueForProperty("Accepted",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)this).Accepted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ConfluentAgreementProperties(content); } /// - /// 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.Confluent.Models.Api20200301.IConfluentAgreementProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ConfluentAgreementProperties(content); } @@ -185,12 +191,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IC /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Terms properties for Marketplace and Confluent. [System.ComponentModel.TypeConverter(typeof(ConfluentAgreementPropertiesTypeConverter))] diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementProperties.TypeConverter.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementProperties.TypeConverter.cs similarity index 96% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementProperties.TypeConverter.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementProperties.TypeConverter.cs index 09577cc76b5b..e85f60e3c6a3 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementProperties.TypeConverter.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementProperties.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementProperties.cs similarity index 91% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementProperties.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementProperties.cs index 8eeb80452ff9..c1fb4abe0bc9 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementProperties.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementProperties.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.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; /// Terms properties for Marketplace and Confluent. public partial class ConfluentAgreementProperties : - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementProperties, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementProperties, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal { /// Backing field for property. @@ -85,6 +85,9 @@ public partial interface IConfluentAgreementProperties : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If any version of the terms have been accepted, otherwise false.", SerializedName = @"accepted", PossibleTypes = new [] { typeof(bool) })] @@ -93,6 +96,9 @@ public partial interface IConfluentAgreementProperties : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Link to HTML with Microsoft and Publisher terms.", SerializedName = @"licenseTextLink", PossibleTypes = new [] { typeof(string) })] @@ -101,6 +107,9 @@ public partial interface IConfluentAgreementProperties : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Plan identifier string.", SerializedName = @"plan", PossibleTypes = new [] { typeof(string) })] @@ -109,6 +118,9 @@ public partial interface IConfluentAgreementProperties : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Link to the privacy policy of the publisher.", SerializedName = @"privacyPolicyLink", PossibleTypes = new [] { typeof(string) })] @@ -117,6 +129,9 @@ public partial interface IConfluentAgreementProperties : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Product identifier string.", SerializedName = @"product", PossibleTypes = new [] { typeof(string) })] @@ -125,6 +140,9 @@ public partial interface IConfluentAgreementProperties : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Publisher identifier string.", SerializedName = @"publisher", PossibleTypes = new [] { typeof(string) })] @@ -135,6 +153,9 @@ public partial interface IConfluentAgreementProperties : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Date and time in UTC of when the terms were accepted. This is empty if Accepted is false.", SerializedName = @"retrieveDatetime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -143,6 +164,9 @@ public partial interface IConfluentAgreementProperties : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Terms signature.", SerializedName = @"signature", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementProperties.json.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementProperties.json.cs similarity index 91% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementProperties.json.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementProperties.json.cs index a95bbde11320..ca396555be49 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementProperties.json.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; @@ -65,25 +65,25 @@ internal ConfluentAgreementProperties(Microsoft.Azure.PowerShell.Cmdlets.Conflue { return; } - {_publisher = If( json?.PropertyT("publisher"), out var __jsonPublisher) ? (string)__jsonPublisher : (string)Publisher;} - {_product = If( json?.PropertyT("product"), out var __jsonProduct) ? (string)__jsonProduct : (string)Product;} - {_plan = If( json?.PropertyT("plan"), out var __jsonPlan) ? (string)__jsonPlan : (string)Plan;} - {_licenseTextLink = If( json?.PropertyT("licenseTextLink"), out var __jsonLicenseTextLink) ? (string)__jsonLicenseTextLink : (string)LicenseTextLink;} - {_privacyPolicyLink = If( json?.PropertyT("privacyPolicyLink"), out var __jsonPrivacyPolicyLink) ? (string)__jsonPrivacyPolicyLink : (string)PrivacyPolicyLink;} - {_retrieveDatetime = If( json?.PropertyT("retrieveDatetime"), out var __jsonRetrieveDatetime) ? global::System.DateTime.TryParse((string)__jsonRetrieveDatetime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonRetrieveDatetimeValue) ? __jsonRetrieveDatetimeValue : RetrieveDatetime : RetrieveDatetime;} - {_signature = If( json?.PropertyT("signature"), out var __jsonSignature) ? (string)__jsonSignature : (string)Signature;} - {_accepted = If( json?.PropertyT("accepted"), out var __jsonAccepted) ? (bool?)__jsonAccepted : Accepted;} + {_publisher = If( json?.PropertyT("publisher"), out var __jsonPublisher) ? (string)__jsonPublisher : (string)_publisher;} + {_product = If( json?.PropertyT("product"), out var __jsonProduct) ? (string)__jsonProduct : (string)_product;} + {_plan = If( json?.PropertyT("plan"), out var __jsonPlan) ? (string)__jsonPlan : (string)_plan;} + {_licenseTextLink = If( json?.PropertyT("licenseTextLink"), out var __jsonLicenseTextLink) ? (string)__jsonLicenseTextLink : (string)_licenseTextLink;} + {_privacyPolicyLink = If( json?.PropertyT("privacyPolicyLink"), out var __jsonPrivacyPolicyLink) ? (string)__jsonPrivacyPolicyLink : (string)_privacyPolicyLink;} + {_retrieveDatetime = If( json?.PropertyT("retrieveDatetime"), out var __jsonRetrieveDatetime) ? global::System.DateTime.TryParse((string)__jsonRetrieveDatetime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonRetrieveDatetimeValue) ? __jsonRetrieveDatetimeValue : _retrieveDatetime : _retrieveDatetime;} + {_signature = If( json?.PropertyT("signature"), out var __jsonSignature) ? (string)__jsonSignature : (string)_signature;} + {_accepted = If( json?.PropertyT("accepted"), out var __jsonAccepted) ? (bool?)__jsonAccepted : _accepted;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject json ? new ConfluentAgreementProperties(json) : null; } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementResource.PowerShell.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementResource.PowerShell.cs similarity index 55% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementResource.PowerShell.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementResource.PowerShell.cs index d2e36d0c8d8b..701802e802c0 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementResource.PowerShell.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementResource.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class ConfluentAgreementResource 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,57 +78,57 @@ internal ConfluentAgreementResource(global::System.Collections.IDictionary conte // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ConfluentAgreementPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ConfluentAgreementPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Publisher")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Publisher, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Publisher, global::System.Convert.ToString); } if (content.Contains("Product")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Product, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Product, global::System.Convert.ToString); } if (content.Contains("Plan")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Plan = (string) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Plan, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Plan = (string) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Plan, global::System.Convert.ToString); } if (content.Contains("LicenseTextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).LicenseTextLink = (string) content.GetValueForProperty("LicenseTextLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).LicenseTextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).LicenseTextLink = (string) content.GetValueForProperty("LicenseTextLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).LicenseTextLink, global::System.Convert.ToString); } if (content.Contains("PrivacyPolicyLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).PrivacyPolicyLink = (string) content.GetValueForProperty("PrivacyPolicyLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).PrivacyPolicyLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).PrivacyPolicyLink = (string) content.GetValueForProperty("PrivacyPolicyLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).PrivacyPolicyLink, global::System.Convert.ToString); } if (content.Contains("RetrieveDatetime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).RetrieveDatetime = (global::System.DateTime?) content.GetValueForProperty("RetrieveDatetime",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).RetrieveDatetime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).RetrieveDatetime = (global::System.DateTime?) content.GetValueForProperty("RetrieveDatetime",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).RetrieveDatetime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Signature")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Signature = (string) content.GetValueForProperty("Signature",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Signature, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Signature = (string) content.GetValueForProperty("Signature",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Signature, global::System.Convert.ToString); } if (content.Contains("Accepted")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Accepted = (bool?) content.GetValueForProperty("Accepted",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Accepted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Accepted = (bool?) content.GetValueForProperty("Accepted",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Accepted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -135,79 +143,77 @@ internal ConfluentAgreementResource(global::System.Management.Automation.PSObjec // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ConfluentAgreementPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ConfluentAgreementPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Publisher")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Publisher, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Publisher, global::System.Convert.ToString); } if (content.Contains("Product")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Product, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Product, global::System.Convert.ToString); } if (content.Contains("Plan")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Plan = (string) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Plan, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Plan = (string) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Plan, global::System.Convert.ToString); } if (content.Contains("LicenseTextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).LicenseTextLink = (string) content.GetValueForProperty("LicenseTextLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).LicenseTextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).LicenseTextLink = (string) content.GetValueForProperty("LicenseTextLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).LicenseTextLink, global::System.Convert.ToString); } if (content.Contains("PrivacyPolicyLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).PrivacyPolicyLink = (string) content.GetValueForProperty("PrivacyPolicyLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).PrivacyPolicyLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).PrivacyPolicyLink = (string) content.GetValueForProperty("PrivacyPolicyLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).PrivacyPolicyLink, global::System.Convert.ToString); } if (content.Contains("RetrieveDatetime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).RetrieveDatetime = (global::System.DateTime?) content.GetValueForProperty("RetrieveDatetime",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).RetrieveDatetime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).RetrieveDatetime = (global::System.DateTime?) content.GetValueForProperty("RetrieveDatetime",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).RetrieveDatetime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Signature")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Signature = (string) content.GetValueForProperty("Signature",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Signature, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Signature = (string) content.GetValueForProperty("Signature",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Signature, global::System.Convert.ToString); } if (content.Contains("Accepted")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Accepted = (bool?) content.GetValueForProperty("Accepted",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal)this).Accepted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Accepted = (bool?) content.GetValueForProperty("Accepted",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal)this).Accepted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ConfluentAgreementResource(content); } /// - /// 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.Confluent.Models.Api20200301.IConfluentAgreementResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ConfluentAgreementResource(content); } @@ -217,12 +223,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IC /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Confluent Agreements Resource. [System.ComponentModel.TypeConverter(typeof(ConfluentAgreementResourceTypeConverter))] diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementResource.TypeConverter.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementResource.TypeConverter.cs similarity index 96% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementResource.TypeConverter.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementResource.TypeConverter.cs index 595bceccce90..44394fc51fff 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementResource.TypeConverter.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementResource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementResource.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementResource.cs similarity index 69% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementResource.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementResource.cs index daeeea4eae9d..e3050cf692b2 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementResource.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementResource.cs @@ -3,19 +3,19 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; /// Confluent Agreements Resource. public partial class ConfluentAgreementResource : - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResource, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResource, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal { /// If any version of the terms have been accepted, otherwise false. [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public bool? Accepted { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)Property).Accepted; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)Property).Accepted = value ?? default(bool); } + public bool? Accepted { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)Property).Accepted; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)Property).Accepted = value ?? default(bool); } /// Backing field for property. private string _id; @@ -26,19 +26,19 @@ public partial class ConfluentAgreementResource : /// Link to HTML with Microsoft and Publisher terms. [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string LicenseTextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)Property).LicenseTextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)Property).LicenseTextLink = value ?? null; } + public string LicenseTextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)Property).LicenseTextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)Property).LicenseTextLink = value ?? null; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementProperties Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ConfluentAgreementProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementProperties Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ConfluentAgreementProperties()); set { {_property = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -49,36 +49,40 @@ public partial class ConfluentAgreementResource : /// Plan identifier string. [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string Plan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)Property).Plan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)Property).Plan = value ?? null; } + public string Plan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)Property).Plan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)Property).Plan = value ?? null; } /// Link to the privacy policy of the publisher. [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string PrivacyPolicyLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)Property).PrivacyPolicyLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)Property).PrivacyPolicyLink = value ?? null; } + public string PrivacyPolicyLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)Property).PrivacyPolicyLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)Property).PrivacyPolicyLink = value ?? null; } /// Product identifier string. [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string Product { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)Property).Product; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)Property).Product = value ?? null; } + public string Product { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)Property).Product; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)Property).Product = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementProperties _property; /// Represents the properties of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ConfluentAgreementProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ConfluentAgreementProperties()); set => this._property = value; } /// Publisher identifier string. [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string Publisher { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)Property).Publisher; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)Property).Publisher = value ?? null; } + public string Publisher { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)Property).Publisher; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)Property).Publisher = value ?? null; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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); } /// /// Date and time in UTC of when the terms were accepted. This is empty if Accepted is false. /// [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public global::System.DateTime? RetrieveDatetime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)Property).RetrieveDatetime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)Property).RetrieveDatetime = value ?? default(global::System.DateTime); } + public global::System.DateTime? RetrieveDatetime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)Property).RetrieveDatetime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)Property).RetrieveDatetime = value ?? default(global::System.DateTime); } /// Terms signature. [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string Signature { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)Property).Signature; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementPropertiesInternal)Property).Signature = value ?? null; } + public string Signature { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)Property).Signature; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementPropertiesInternal)Property).Signature = value ?? null; } /// Backing field for property. private string _type; @@ -101,6 +105,9 @@ public partial interface IConfluentAgreementResource : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If any version of the terms have been accepted, otherwise false.", SerializedName = @"accepted", PossibleTypes = new [] { typeof(bool) })] @@ -109,6 +116,9 @@ public partial interface IConfluentAgreementResource : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"ARM id of the resource.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -117,6 +127,9 @@ public partial interface IConfluentAgreementResource : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Link to HTML with Microsoft and Publisher terms.", SerializedName = @"licenseTextLink", PossibleTypes = new [] { typeof(string) })] @@ -125,6 +138,9 @@ public partial interface IConfluentAgreementResource : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Name of the agreement.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -133,6 +149,9 @@ public partial interface IConfluentAgreementResource : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Plan identifier string.", SerializedName = @"plan", PossibleTypes = new [] { typeof(string) })] @@ -141,6 +160,9 @@ public partial interface IConfluentAgreementResource : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Link to the privacy policy of the publisher.", SerializedName = @"privacyPolicyLink", PossibleTypes = new [] { typeof(string) })] @@ -149,6 +171,9 @@ public partial interface IConfluentAgreementResource : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Product identifier string.", SerializedName = @"product", PossibleTypes = new [] { typeof(string) })] @@ -157,6 +182,9 @@ public partial interface IConfluentAgreementResource : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Publisher identifier string.", SerializedName = @"publisher", PossibleTypes = new [] { typeof(string) })] @@ -167,6 +195,9 @@ public partial interface IConfluentAgreementResource : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Date and time in UTC of when the terms were accepted. This is empty if Accepted is false.", SerializedName = @"retrieveDatetime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -175,6 +206,9 @@ public partial interface IConfluentAgreementResource : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Terms signature.", SerializedName = @"signature", PossibleTypes = new [] { typeof(string) })] @@ -183,6 +217,9 @@ public partial interface IConfluentAgreementResource : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of the resource.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -208,7 +245,7 @@ internal partial interface IConfluentAgreementResourceInternal /// Product identifier string. string Product { get; set; } /// Represents the properties of the resource. - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementProperties Property { get; set; } /// Publisher identifier string. string Publisher { get; set; } /// diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementResource.json.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementResource.json.cs similarity index 91% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementResource.json.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementResource.json.cs index 0444d3d186e2..e5f57550fadc 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementResource.json.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementResource.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; @@ -65,21 +65,21 @@ internal ConfluentAgreementResource(Microsoft.Azure.PowerShell.Cmdlets.Confluent { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ConfluentAgreementProperties.FromJson(__jsonProperties) : Property;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ConfluentAgreementProperties.FromJson(__jsonProperties) : _property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject json ? new ConfluentAgreementResource(json) : null; } @@ -104,15 +104,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode ToJson return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementResourceListResponse.PowerShell.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementResourceListResponse.PowerShell.cs similarity index 68% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementResourceListResponse.PowerShell.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementResourceListResponse.PowerShell.cs index c30ff4a14fa5..1d39e549a0a9 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementResourceListResponse.PowerShell.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementResourceListResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class ConfluentAgreementResourceListResponse 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 ConfluentAgreementResourceListResponse(global::System.Collections.IDict // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceListResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ConfluentAgreementResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceListResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ConfluentAgreementResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceListResponseInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceListResponseInternal)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. @@ -95,39 +103,39 @@ internal ConfluentAgreementResourceListResponse(global::System.Management.Automa // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceListResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ConfluentAgreementResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceListResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ConfluentAgreementResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceListResponseInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceListResponseInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceListResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceListResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ConfluentAgreementResourceListResponse(content); } /// - /// 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.Confluent.Models.Api20200301.IConfluentAgreementResourceListResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceListResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ConfluentAgreementResourceListResponse(content); } @@ -140,12 +148,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IC /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceListResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceListResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Response of a list operation. [System.ComponentModel.TypeConverter(typeof(ConfluentAgreementResourceListResponseTypeConverter))] diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementResourceListResponse.TypeConverter.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementResourceListResponse.TypeConverter.cs similarity index 96% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementResourceListResponse.TypeConverter.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementResourceListResponse.TypeConverter.cs index 1da6cba22175..1e80de9cc057 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementResourceListResponse.TypeConverter.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementResourceListResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Models.Api20200301.IConfluentAgreementResourceListResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceListResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceListResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceListResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementResourceListResponse.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementResourceListResponse.cs similarity index 70% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementResourceListResponse.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementResourceListResponse.cs index 6784c9d04fb7..05e8d0be69d2 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementResourceListResponse.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementResourceListResponse.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.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; /// Response of a list operation. public partial class ConfluentAgreementResourceListResponse : - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceListResponse, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceListResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceListResponse, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceListResponseInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class ConfluentAgreementResourceListResponse : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResource[] _value; + private System.Collections.Generic.List _value; /// Results of a list operation. [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResource[] 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 ConfluentAgreementResourceListResponse() @@ -41,6 +41,9 @@ public partial interface IConfluentAgreementResourceListResponse : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Link to the next set of results, if any.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IConfluentAgreementResourceListResponse : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Results of a list operation.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResource) })] - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResource[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResource) })] + System.Collections.Generic.List Value { get; set; } } /// Response of a list operation. @@ -62,7 +68,7 @@ internal partial interface IConfluentAgreementResourceListResponseInternal /// Link to the next set of results, if any. string NextLink { get; set; } /// Results of a list operation. - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResource[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementResourceListResponse.json.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementResourceListResponse.json.cs similarity index 89% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementResourceListResponse.json.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementResourceListResponse.json.cs index 4593ca85268a..29682a224591 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ConfluentAgreementResourceListResponse.json.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentAgreementResourceListResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ConfluentAgreementResourceListResponse(Microsoft.Azure.PowerShell.Cmdle { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Models.Api20200301.IConfluentAgreementResource) (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ConfluentAgreementResource.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.Confluent.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.Confluent.Models.IConfluentAgreementResource) (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ConfluentAgreementResource.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.Confluent.Models.Api20200301.IConfluentAgreementResourceListResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceListResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceListResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceListResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceListResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceListResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject json ? new ConfluentAgreementResourceListResponse(json) : null; } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentIdentity.PowerShell.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentIdentity.PowerShell.cs index c8feb5f15f48..5ccb556e7623 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentIdentity.PowerShell.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentIdentity.PowerShell.cs @@ -53,6 +53,14 @@ public partial class ConfluentIdentity partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a 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 . @@ -156,6 +164,18 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentIden /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeAll)?.ToString(); + + 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(ConfluentIdentityTypeConverter))] public partial interface IConfluentIdentity diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentIdentity.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentIdentity.cs index e5ca07b28078..20542c4d981d 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentIdentity.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentIdentity.cs @@ -53,6 +53,9 @@ public partial interface IConfluentIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource identity path", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -61,6 +64,9 @@ public partial interface IConfluentIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Organization resource name", SerializedName = @"organizationName", PossibleTypes = new [] { typeof(string) })] @@ -69,6 +75,9 @@ public partial interface IConfluentIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource group name", SerializedName = @"resourceGroupName", PossibleTypes = new [] { typeof(string) })] @@ -77,6 +86,9 @@ public partial interface IConfluentIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Microsoft Azure subscription id", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentIdentity.json.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentIdentity.json.cs index b9dfe3bd3b19..279d4c8a7507 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentIdentity.json.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/ConfluentIdentity.json.cs @@ -64,10 +64,10 @@ internal ConfluentIdentity(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime. { 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;} - {_organizationName = If( json?.PropertyT("organizationName"), out var __jsonOrganizationName) ? (string)__jsonOrganizationName : (string)OrganizationName;} - {_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;} + {_organizationName = If( json?.PropertyT("organizationName"), out var __jsonOrganizationName) ? (string)__jsonOrganizationName : (string)_organizationName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ErrorResponseBody.PowerShell.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/ErrorResponseBody.PowerShell.cs similarity index 66% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ErrorResponseBody.PowerShell.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/ErrorResponseBody.PowerShell.cs index 54bc8706e440..354770797e55 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ErrorResponseBody.PowerShell.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/ErrorResponseBody.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class ErrorResponseBody 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.Confluent.Models.Api20200301.IErrorResponseBody DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBody DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorResponseBody(content); } /// - /// 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.Confluent.Models.Api20200301.IErrorResponseBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorResponseBody(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,25 +104,25 @@ internal ErrorResponseBody(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ErrorResponseBodyTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ErrorResponseBodyTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -129,19 +137,19 @@ internal ErrorResponseBody(global::System.Management.Automation.PSObject content // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ErrorResponseBodyTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ErrorResponseBodyTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -151,12 +159,24 @@ internal ErrorResponseBody(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.Confluent.Models.Api20200301.IErrorResponseBody FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBody FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Response body of Error [System.ComponentModel.TypeConverter(typeof(ErrorResponseBodyTypeConverter))] diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ErrorResponseBody.TypeConverter.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/ErrorResponseBody.TypeConverter.cs similarity index 97% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ErrorResponseBody.TypeConverter.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/ErrorResponseBody.TypeConverter.cs index c76740b2e00c..286e3986bc19 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ErrorResponseBody.TypeConverter.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/ErrorResponseBody.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBody ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBody).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ErrorResponseBody.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/ErrorResponseBody.cs similarity index 72% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ErrorResponseBody.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/ErrorResponseBody.cs index 2245db39659a..bb65b8ba9938 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ErrorResponseBody.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/ErrorResponseBody.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.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; /// Response body of Error public partial class ErrorResponseBody : - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBody, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class ErrorResponseBody : public string Code { get => this._code; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody[] _detail; + private System.Collections.Generic.List _detail; /// Error detail [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody[] Detail { get => this._detail; } + public System.Collections.Generic.List Detail { get => this._detail; } /// Backing field for property. private string _message; @@ -35,16 +35,16 @@ public partial class ErrorResponseBody : public string Message { get => this._message; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal.Code { get => this._code; set { {_code = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal.Code { get => this._code; set { {_code = value;} } } /// Internal Acessors for Detail - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody[] Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal.Detail { get => this._detail; set { {_detail = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal.Detail { get => this._detail; set { {_detail = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal.Message { get => this._message; set { {_message = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal.Message { get => this._message; set { {_message = value;} } } /// Internal Acessors for Target - string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal.Target { get => this._target; set { {_target = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal.Target { get => this._target; set { {_target = value;} } } /// Backing field for property. private string _target; @@ -67,6 +67,9 @@ public partial interface IErrorResponseBody : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error code", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -75,14 +78,20 @@ public partial interface IErrorResponseBody : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error detail", SerializedName = @"details", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody) })] - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody[] Detail { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBody) })] + System.Collections.Generic.List Detail { get; } /// Error message [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error message", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -91,6 +100,9 @@ public partial interface IErrorResponseBody : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error target", SerializedName = @"target", PossibleTypes = new [] { typeof(string) })] @@ -104,7 +116,7 @@ internal partial interface IErrorResponseBodyInternal /// Error code string Code { get; set; } /// Error detail - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody[] Detail { get; set; } + System.Collections.Generic.List Detail { get; set; } /// Error message string Message { get; set; } /// Error target diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ErrorResponseBody.json.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/ErrorResponseBody.json.cs similarity index 87% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ErrorResponseBody.json.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/ErrorResponseBody.json.cs index 4e503dc09a51..86d59471e8cd 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ErrorResponseBody.json.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/ErrorResponseBody.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; @@ -65,21 +65,21 @@ internal ErrorResponseBody(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime. { 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.Confluent.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.Confluent.Models.Api20200301.IErrorResponseBody) (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ErrorResponseBody.FromJson(__u) )) ))() : null : Detail;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} + {_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.Confluent.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.Confluent.Models.IErrorResponseBody) (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ErrorResponseBody.FromJson(__u) )) ))() : null : _detail;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBody. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBody. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBody FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject json ? new ErrorResponseBody(json) : null; } @@ -103,19 +103,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode ToJson { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._target)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonString(this._target.ToString()) : null, "target" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeRead)) { if (null != this._detail) { diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OfferDetail.PowerShell.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OfferDetail.PowerShell.cs similarity index 66% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OfferDetail.PowerShell.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OfferDetail.PowerShell.cs index 6f727f581fde..250f0cf0309e 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OfferDetail.PowerShell.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OfferDetail.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class OfferDetail 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.Confluent.Models.Api20200301.IOfferDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OfferDetail(content); } /// - /// 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.Confluent.Models.Api20200301.IOfferDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OfferDetail(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IO /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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 OfferDetail(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("PublisherId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).PublisherId = (string) content.GetValueForProperty("PublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).PublisherId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).PublisherId = (string) content.GetValueForProperty("PublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).PublisherId, global::System.Convert.ToString); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("PlanId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).PlanId = (string) content.GetValueForProperty("PlanId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).PlanId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).PlanId = (string) content.GetValueForProperty("PlanId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).PlanId, global::System.Convert.ToString); } if (content.Contains("PlanName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).PlanName = (string) content.GetValueForProperty("PlanName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).PlanName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).PlanName = (string) content.GetValueForProperty("PlanName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).PlanName, global::System.Convert.ToString); } if (content.Contains("TermUnit")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).TermUnit = (string) content.GetValueForProperty("TermUnit",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).TermUnit, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).TermUnit = (string) content.GetValueForProperty("TermUnit",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).TermUnit, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).Status, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -144,27 +152,27 @@ internal OfferDetail(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("PublisherId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).PublisherId = (string) content.GetValueForProperty("PublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).PublisherId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).PublisherId = (string) content.GetValueForProperty("PublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).PublisherId, global::System.Convert.ToString); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("PlanId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).PlanId = (string) content.GetValueForProperty("PlanId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).PlanId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).PlanId = (string) content.GetValueForProperty("PlanId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).PlanId, global::System.Convert.ToString); } if (content.Contains("PlanName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).PlanName = (string) content.GetValueForProperty("PlanName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).PlanName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).PlanName = (string) content.GetValueForProperty("PlanName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).PlanName, global::System.Convert.ToString); } if (content.Contains("TermUnit")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).TermUnit = (string) content.GetValueForProperty("TermUnit",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).TermUnit, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).TermUnit = (string) content.GetValueForProperty("TermUnit",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).TermUnit, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).Status, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -173,6 +181,18 @@ internal OfferDetail(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Confluent Offer detail [System.ComponentModel.TypeConverter(typeof(OfferDetailTypeConverter))] diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OfferDetail.TypeConverter.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OfferDetail.TypeConverter.cs similarity index 97% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OfferDetail.TypeConverter.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OfferDetail.TypeConverter.cs index 634fe1eec8ff..523d2a9d55c7 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OfferDetail.TypeConverter.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OfferDetail.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetail ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetail ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetail).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetail).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OfferDetail.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OfferDetail.cs similarity index 79% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OfferDetail.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OfferDetail.cs index 9657ae1a674c..5ef738c681df 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OfferDetail.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OfferDetail.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.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; /// Confluent Offer detail public partial class OfferDetail : - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetail, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetail, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal { /// Backing field for property. @@ -21,7 +21,7 @@ public partial class OfferDetail : public string Id { get => this._id; set => this._id = value; } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal.Status { get => this._status; set { {_status = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal.Status { get => this._status; set { {_status = value;} } } /// Backing field for property. private string _planId; @@ -45,11 +45,11 @@ public partial class OfferDetail : public string PublisherId { get => this._publisherId; set => this._publisherId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus? _status; + private string _status; /// SaaS Offer Status [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus? Status { get => this._status; } + public string Status { get => this._status; } /// Backing field for property. private string _termUnit; @@ -72,6 +72,9 @@ public partial interface IOfferDetail : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Offer Id", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -80,6 +83,9 @@ public partial interface IOfferDetail : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Offer Plan Id", SerializedName = @"planId", PossibleTypes = new [] { typeof(string) })] @@ -88,6 +94,9 @@ public partial interface IOfferDetail : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Offer Plan Name", SerializedName = @"planName", PossibleTypes = new [] { typeof(string) })] @@ -96,6 +105,9 @@ public partial interface IOfferDetail : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Publisher Id", SerializedName = @"publisherId", PossibleTypes = new [] { typeof(string) })] @@ -104,14 +116,21 @@ public partial interface IOfferDetail : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"SaaS Offer Status", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.PSArgumentCompleterAttribute("Started", "PendingFulfillmentStart", "InProgress", "Subscribed", "Suspended", "Reinstated", "Succeeded", "Failed", "Unsubscribed", "Updating")] + string Status { get; } /// Offer Plan Term unit [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Offer Plan Term unit", SerializedName = @"termUnit", PossibleTypes = new [] { typeof(string) })] @@ -131,7 +150,8 @@ internal partial interface IOfferDetailInternal /// Publisher Id string PublisherId { get; set; } /// SaaS Offer Status - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.PSArgumentCompleterAttribute("Started", "PendingFulfillmentStart", "InProgress", "Subscribed", "Suspended", "Reinstated", "Succeeded", "Failed", "Unsubscribed", "Updating")] + string Status { get; set; } /// Offer Plan Term unit string TermUnit { get; set; } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OfferDetail.json.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OfferDetail.json.cs similarity index 92% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OfferDetail.json.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OfferDetail.json.cs index 3d6280bb63de..915b07229415 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OfferDetail.json.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OfferDetail.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OfferDetail partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetail. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetail. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetail. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetail. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject json ? new OfferDetail(json) : null; } @@ -77,12 +77,12 @@ internal OfferDetail(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.J { return; } - {_publisherId = If( json?.PropertyT("publisherId"), out var __jsonPublisherId) ? (string)__jsonPublisherId : (string)PublisherId;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_planId = If( json?.PropertyT("planId"), out var __jsonPlanId) ? (string)__jsonPlanId : (string)PlanId;} - {_planName = If( json?.PropertyT("planName"), out var __jsonPlanName) ? (string)__jsonPlanName : (string)PlanName;} - {_termUnit = If( json?.PropertyT("termUnit"), out var __jsonTermUnit) ? (string)__jsonTermUnit : (string)TermUnit;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_publisherId = If( json?.PropertyT("publisherId"), out var __jsonPublisherId) ? (string)__jsonPublisherId : (string)_publisherId;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_planId = If( json?.PropertyT("planId"), out var __jsonPlanId) ? (string)__jsonPlanId : (string)_planId;} + {_planName = If( json?.PropertyT("planName"), out var __jsonPlanName) ? (string)__jsonPlanName : (string)_planName;} + {_termUnit = If( json?.PropertyT("termUnit"), out var __jsonTermUnit) ? (string)__jsonTermUnit : (string)_termUnit;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} AfterFromJson(json); } @@ -110,7 +110,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode ToJson AddIf( null != (((object)this._planId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonString(this._planId.ToString()) : null, "planId" ,container.Add ); AddIf( null != (((object)this._planName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonString(this._planName.ToString()) : null, "planName" ,container.Add ); AddIf( null != (((object)this._termUnit)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonString(this._termUnit.ToString()) : null, "termUnit" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationDisplay.PowerShell.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs similarity index 69% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationDisplay.PowerShell.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs index 012029384631..4cad0f344ce7 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationDisplay.PowerShell.cs +++ b/generated/Confluent/Confluent.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.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Models.Api20200301.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Models.Api20200301.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationDisplay(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IO /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Models.Api20200301.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Models.Api20200301.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// The object that represents the operation. [System.ComponentModel.TypeConverter(typeof(OperationDisplayTypeConverter))] diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationDisplay.TypeConverter.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs similarity index 97% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationDisplay.TypeConverter.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs index 13615d1360f7..ed6cad75b042 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationDisplay.TypeConverter.cs +++ b/generated/Confluent/Confluent.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.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplay ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplay ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplay).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplay).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationDisplay.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OperationDisplay.cs similarity index 90% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationDisplay.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OperationDisplay.cs index 93a44647612a..bcb51813934a 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationDisplay.cs +++ b/generated/Confluent/Confluent.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.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; /// The object that represents the operation. public partial class OperationDisplay : - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplay, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplayInternal + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplay, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplayInternal { /// Backing field for property. @@ -55,6 +55,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Description of the operation, e.g., 'Write confluent'.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -63,6 +66,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Operation type, e.g., read, write, delete, etc.", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -71,6 +77,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Service provider: Microsoft.Confluent", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -79,6 +88,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type on which the operation is performed, e.g., 'clusters'.", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationDisplay.json.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OperationDisplay.json.cs similarity index 93% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationDisplay.json.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OperationDisplay.json.cs index 13ad5ef26500..f19042bf407a 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationDisplay.json.cs +++ b/generated/Confluent/Confluent.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.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationDisplay partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplay. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplay. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplay. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplay. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject json ? new OperationDisplay(json) : null; } @@ -77,10 +77,10 @@ internal OperationDisplay(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.J { 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); } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationListResult.PowerShell.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OperationListResult.PowerShell.cs similarity index 70% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationListResult.PowerShell.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OperationListResult.PowerShell.cs index bea7bdca738c..e1ec0a369a3b 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationListResult.PowerShell.cs +++ b/generated/Confluent/Confluent.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.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; @@ -55,27 +55,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.Confluent.Models.Api20200301.IOperationListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Models.Api20200301.IOperationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationListResult(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IO /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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 OperationListResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResult[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OperationResultTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OperationResultTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.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. @@ -128,11 +136,11 @@ internal OperationListResult(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResult[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OperationResultTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OperationResultTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -141,6 +149,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.Confluent.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Result of GET request to list Confluent operations. [System.ComponentModel.TypeConverter(typeof(OperationListResultTypeConverter))] diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationListResult.TypeConverter.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs similarity index 97% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationListResult.TypeConverter.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs index 499ef7a5ca85..f859663c0f77 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationListResult.TypeConverter.cs +++ b/generated/Confluent/Confluent.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.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationListResult.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OperationListResult.cs similarity index 73% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationListResult.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OperationListResult.cs index f6a92e746601..41b5d645e5e6 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationListResult.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OperationListResult.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.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; /// Result of GET request to list Confluent operations. public partial class OperationListResult : - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationListResult, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationListResult, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationListResultInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Backing field for property. private string _nextLink; @@ -24,11 +24,11 @@ public partial class OperationListResult : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResult[] _value; + private System.Collections.Generic.List _value; /// List of Confluent operations supported by the Microsoft.Confluent provider. [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResult[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public OperationListResult() @@ -44,6 +44,9 @@ public partial interface IOperationListResult : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.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) })] @@ -52,10 +55,13 @@ public partial interface IOperationListResult : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of Confluent operations supported by the Microsoft.Confluent provider.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResult) })] - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResult[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResult) })] + System.Collections.Generic.List Value { get; set; } } /// Result of GET request to list Confluent operations. @@ -65,7 +71,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 Confluent operations supported by the Microsoft.Confluent provider. - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResult[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationListResult.json.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OperationListResult.json.cs similarity index 89% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationListResult.json.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OperationListResult.json.cs index 42c548697c7f..c314c9cd6ec0 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationListResult.json.cs +++ b/generated/Confluent/Confluent.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.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject json ? new OperationListResult(json) : null; } @@ -77,8 +77,8 @@ internal OperationListResult(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtim { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Models.Api20200301.IOperationResult) (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OperationResult.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.Confluent.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.Confluent.Models.IOperationResult) (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OperationResult.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } @@ -110,7 +110,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode ToJson } container.Add("value",__w); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationResult.PowerShell.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OperationResult.PowerShell.cs similarity index 62% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationResult.PowerShell.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OperationResult.PowerShell.cs index 9df8e1e9a3fa..d930023215f6 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationResult.PowerShell.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OperationResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class OperationResult 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.Confluent.Models.Api20200301.IOperationResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationResult(content); } /// - /// 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.Confluent.Models.Api20200301.IOperationResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationResult(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IO /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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,37 +111,37 @@ internal OperationResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OperationDisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OperationDisplayTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("IsDataAction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).DisplayOperation, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)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. @@ -148,31 +156,31 @@ internal OperationResult(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OperationDisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OperationDisplayTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("IsDataAction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).DisplayOperation, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal)this).DisplayDescription, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -181,6 +189,18 @@ internal OperationResult(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeAll)?.ToString(); + + 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 Confluent REST API operation. [System.ComponentModel.TypeConverter(typeof(OperationResultTypeConverter))] diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationResult.TypeConverter.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OperationResult.TypeConverter.cs similarity index 97% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationResult.TypeConverter.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OperationResult.TypeConverter.cs index ac4c6c160c9f..3eee45039907 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationResult.TypeConverter.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OperationResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationResult.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OperationResult.cs similarity index 76% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationResult.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OperationResult.cs index 046bc6e03d69..c5e2464160a5 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationResult.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OperationResult.cs @@ -3,38 +3,38 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; /// An Confluent REST API operation. public partial class OperationResult : - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResult, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResult, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplay _display; + private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplay _display; /// The object that represents the operation. [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OperationDisplay()); set => this._display = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OperationDisplay()); set => this._display = value; } /// Description of the operation, e.g., 'Write confluent'. [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplayInternal)Display).Description = value ?? null; } + public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplayInternal)Display).Description = value ?? null; } /// Operation type, e.g., read, write, delete, etc. [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplayInternal)Display).Operation = value ?? null; } + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplayInternal)Display).Operation = value ?? null; } /// Service provider: Microsoft.Confluent [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplayInternal)Display).Provider = value ?? null; } + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplayInternal)Display).Provider = value ?? null; } /// Type on which the operation is performed, e.g., 'clusters'. [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplayInternal)Display).Resource = value ?? null; } + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplayInternal)Display).Resource = value ?? null; } /// Backing field for property. private bool? _isDataAction; @@ -44,7 +44,7 @@ public partial class OperationResult : public bool? IsDataAction { get => this._isDataAction; set => this._isDataAction = value; } /// Internal Acessors for Display - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResultInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OperationDisplay()); set { {_display = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResultInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OperationDisplay()); set { {_display = value;} } } /// Backing field for property. private string _name; @@ -67,6 +67,9 @@ public partial interface IOperationResult : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Description of the operation, e.g., 'Write confluent'.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -75,6 +78,9 @@ public partial interface IOperationResult : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Operation type, e.g., read, write, delete, etc.", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -83,6 +89,9 @@ public partial interface IOperationResult : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Service provider: Microsoft.Confluent", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -91,6 +100,9 @@ public partial interface IOperationResult : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type on which the operation is performed, e.g., 'clusters'.", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] @@ -99,6 +111,9 @@ public partial interface IOperationResult : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether the operation is a data action", SerializedName = @"isDataAction", PossibleTypes = new [] { typeof(bool) })] @@ -107,6 +122,9 @@ public partial interface IOperationResult : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Operation name: {provider}/{resource}/{operation}", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -118,7 +136,7 @@ internal partial interface IOperationResultInternal { /// The object that represents the operation. - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationDisplay Display { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationDisplay Display { get; set; } /// Description of the operation, e.g., 'Write confluent'. string DisplayDescription { get; set; } /// Operation type, e.g., read, write, delete, etc. diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationResult.json.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OperationResult.json.cs similarity index 94% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationResult.json.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OperationResult.json.cs index 359da18fbf9b..30d635895316 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OperationResult.json.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OperationResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject json ? new OperationResult(json) : null; } @@ -77,9 +77,9 @@ internal OperationResult(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Js { return; } - {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.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;} + {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.Confluent.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;} AfterFromJson(json); } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResource.PowerShell.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResource.PowerShell.cs new file mode 100644 index 000000000000..198f1f581cfa --- /dev/null +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResource.PowerShell.cs @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; + + /// Organization resource. + [System.ComponentModel.TypeConverter(typeof(OrganizationResourceTypeConverter))] + public partial class OrganizationResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OrganizationResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OrganizationResource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OrganizationResource(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.Confluent.Models.IOrganizationResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailPublisherId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetailPublisherId = (string) content.GetValueForProperty("OfferDetailPublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetailPublisherId, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetailId = (string) content.GetValueForProperty("OfferDetailId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetailId, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailPlanId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetailPlanId = (string) content.GetValueForProperty("OfferDetailPlanId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetailPlanId, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailPlanName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetailPlanName = (string) content.GetValueForProperty("OfferDetailPlanName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetailPlanName, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailTermUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetailTermUnit = (string) content.GetValueForProperty("OfferDetailTermUnit",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetailTermUnit, global::System.Convert.ToString); + } + if (content.Contains("UserDetailFirstName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).UserDetailFirstName = (string) content.GetValueForProperty("UserDetailFirstName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).UserDetailFirstName, global::System.Convert.ToString); + } + if (content.Contains("UserDetailLastName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).UserDetailLastName = (string) content.GetValueForProperty("UserDetailLastName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).UserDetailLastName, global::System.Convert.ToString); + } + if (content.Contains("UserDetailEmailAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).UserDetailEmailAddress = (string) content.GetValueForProperty("UserDetailEmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).UserDetailEmailAddress, global::System.Convert.ToString); + } + if (content.Contains("OfferDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesOfferDetail) content.GetValueForProperty("OfferDetail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetail, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesOfferDetailTypeConverter.ConvertFrom); + } + if (content.Contains("UserDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).UserDetail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesUserDetail) content.GetValueForProperty("UserDetail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).UserDetail, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesUserDetailTypeConverter.ConvertFrom); + } + if (content.Contains("CreatedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).CreatedTime = (global::System.DateTime?) content.GetValueForProperty("CreatedTime",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).CreatedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("OrganizationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OrganizationId = (string) content.GetValueForProperty("OrganizationId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OrganizationId, global::System.Convert.ToString); + } + if (content.Contains("SsoUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).SsoUrl = (string) content.GetValueForProperty("SsoUrl",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).SsoUrl, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetailStatus = (string) content.GetValueForProperty("OfferDetailStatus",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetailStatus, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OrganizationResource(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.Confluent.Models.IOrganizationResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailPublisherId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetailPublisherId = (string) content.GetValueForProperty("OfferDetailPublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetailPublisherId, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetailId = (string) content.GetValueForProperty("OfferDetailId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetailId, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailPlanId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetailPlanId = (string) content.GetValueForProperty("OfferDetailPlanId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetailPlanId, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailPlanName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetailPlanName = (string) content.GetValueForProperty("OfferDetailPlanName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetailPlanName, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailTermUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetailTermUnit = (string) content.GetValueForProperty("OfferDetailTermUnit",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetailTermUnit, global::System.Convert.ToString); + } + if (content.Contains("UserDetailFirstName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).UserDetailFirstName = (string) content.GetValueForProperty("UserDetailFirstName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).UserDetailFirstName, global::System.Convert.ToString); + } + if (content.Contains("UserDetailLastName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).UserDetailLastName = (string) content.GetValueForProperty("UserDetailLastName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).UserDetailLastName, global::System.Convert.ToString); + } + if (content.Contains("UserDetailEmailAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).UserDetailEmailAddress = (string) content.GetValueForProperty("UserDetailEmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).UserDetailEmailAddress, global::System.Convert.ToString); + } + if (content.Contains("OfferDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesOfferDetail) content.GetValueForProperty("OfferDetail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetail, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesOfferDetailTypeConverter.ConvertFrom); + } + if (content.Contains("UserDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).UserDetail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesUserDetail) content.GetValueForProperty("UserDetail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).UserDetail, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesUserDetailTypeConverter.ConvertFrom); + } + if (content.Contains("CreatedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).CreatedTime = (global::System.DateTime?) content.GetValueForProperty("CreatedTime",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).CreatedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("OrganizationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OrganizationId = (string) content.GetValueForProperty("OrganizationId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OrganizationId, global::System.Convert.ToString); + } + if (content.Contains("SsoUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).SsoUrl = (string) content.GetValueForProperty("SsoUrl",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).SsoUrl, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetailStatus = (string) content.GetValueForProperty("OfferDetailStatus",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal)this).OfferDetailStatus, 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.Confluent.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Organization resource. + [System.ComponentModel.TypeConverter(typeof(OrganizationResourceTypeConverter))] + public partial interface IOrganizationResource + + { + + } +} \ No newline at end of file diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResource.TypeConverter.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResource.TypeConverter.cs similarity index 97% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResource.TypeConverter.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResource.TypeConverter.cs index 463be55534a6..405abbdc8cc5 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResource.TypeConverter.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResource.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResource.cs similarity index 58% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResource.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResource.cs index 651c6917488b..a54cbcb00434 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResource.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResource.cs @@ -3,19 +3,19 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; /// Organization resource. public partial class OrganizationResource : - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal { /// The creation time of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public global::System.DateTime? CreatedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).CreatedTime; } + public global::System.DateTime? CreatedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).CreatedTime; } /// Backing field for property. private string _id; @@ -32,37 +32,37 @@ public partial class OrganizationResource : public string Location { get => this._location; set => this._location = value; } /// Internal Acessors for CreatedTime - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal.CreatedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).CreatedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).CreatedTime = value; } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal.CreatedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).CreatedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).CreatedTime = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for OfferDetail - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetail Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal.OfferDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).OfferDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).OfferDetail = value; } + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesOfferDetail Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal.OfferDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).OfferDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).OfferDetail = value; } /// Internal Acessors for OfferDetailStatus - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal.OfferDetailStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).OfferDetailStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).OfferDetailStatus = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal.OfferDetailStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).OfferDetailStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).OfferDetailStatus = value; } /// Internal Acessors for OrganizationId - string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal.OrganizationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).OrganizationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).OrganizationId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal.OrganizationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).OrganizationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).OrganizationId = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceProperties Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceProperties Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).ProvisioningState = value; } /// Internal Acessors for SsoUrl - string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal.SsoUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).SsoUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).SsoUrl = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal.SsoUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).SsoUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).SsoUrl = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal.Type { get => this._type; set { {_type = value;} } } /// Internal Acessors for UserDetail - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetail Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceInternal.UserDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).UserDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).UserDetail = value; } + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesUserDetail Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceInternal.UserDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).UserDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).UserDetail = value; } /// Backing field for property. private string _name; @@ -73,53 +73,57 @@ public partial class OrganizationResource : /// Offer Id [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string OfferDetailId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).OfferDetailId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).OfferDetailId = value ?? null; } + public string OfferDetailId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).OfferDetailId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).OfferDetailId = value ?? null; } /// Offer Plan Id [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string OfferDetailPlanId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).OfferDetailPlanId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).OfferDetailPlanId = value ?? null; } + public string OfferDetailPlanId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).OfferDetailPlanId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).OfferDetailPlanId = value ?? null; } /// Offer Plan Name [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string OfferDetailPlanName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).OfferDetailPlanName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).OfferDetailPlanName = value ?? null; } + public string OfferDetailPlanName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).OfferDetailPlanName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).OfferDetailPlanName = value ?? null; } /// Publisher Id [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string OfferDetailPublisherId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).OfferDetailPublisherId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).OfferDetailPublisherId = value ?? null; } + public string OfferDetailPublisherId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).OfferDetailPublisherId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).OfferDetailPublisherId = value ?? null; } /// SaaS Offer Status [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus? OfferDetailStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).OfferDetailStatus; } + public string OfferDetailStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).OfferDetailStatus; } /// Offer Plan Term unit [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string OfferDetailTermUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).OfferDetailTermUnit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).OfferDetailTermUnit = value ?? null; } + public string OfferDetailTermUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).OfferDetailTermUnit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).OfferDetailTermUnit = value ?? null; } /// Id of the Confluent organization. [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string OrganizationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).OrganizationId; } + public string OrganizationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).OrganizationId; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceProperties _property; /// Organization resource properties [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceProperties()); set => this._property = value; } /// Provision states for confluent RP [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).ProvisioningState; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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); } /// SSO url for the Confluent organization. [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string SsoUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).SsoUrl; } + public string SsoUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).SsoUrl; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceTags _tag; /// Organization resource tags [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceTags()); set => this._tag = value; } /// Backing field for property. private string _type; @@ -130,15 +134,15 @@ public partial class OrganizationResource : /// Email address [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string UserDetailEmailAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).UserDetailEmailAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).UserDetailEmailAddress = value ?? null; } + public string UserDetailEmailAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).UserDetailEmailAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).UserDetailEmailAddress = value ?? null; } /// First name [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string UserDetailFirstName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).UserDetailFirstName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).UserDetailFirstName = value ?? null; } + public string UserDetailFirstName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).UserDetailFirstName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).UserDetailFirstName = value ?? null; } /// Last name [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string UserDetailLastName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).UserDetailLastName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal)Property).UserDetailLastName = value ?? null; } + public string UserDetailLastName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).UserDetailLastName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)Property).UserDetailLastName = value ?? null; } /// Creates an new instance. public OrganizationResource() @@ -154,6 +158,9 @@ public partial interface IOrganizationResource : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The creation time of the resource.", SerializedName = @"createdTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -162,6 +169,9 @@ public partial interface IOrganizationResource : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The ARM id of the resource.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -170,6 +180,9 @@ public partial interface IOrganizationResource : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Location of Organization resource", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -178,6 +191,9 @@ public partial interface IOrganizationResource : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the resource.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -186,6 +202,9 @@ public partial interface IOrganizationResource : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Offer Id", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -194,6 +213,9 @@ public partial interface IOrganizationResource : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Offer Plan Id", SerializedName = @"planId", PossibleTypes = new [] { typeof(string) })] @@ -202,6 +224,9 @@ public partial interface IOrganizationResource : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Offer Plan Name", SerializedName = @"planName", PossibleTypes = new [] { typeof(string) })] @@ -210,6 +235,9 @@ public partial interface IOrganizationResource : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Publisher Id", SerializedName = @"publisherId", PossibleTypes = new [] { typeof(string) })] @@ -218,14 +246,21 @@ public partial interface IOrganizationResource : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"SaaS Offer Status", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus? OfferDetailStatus { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.PSArgumentCompleterAttribute("Started", "PendingFulfillmentStart", "InProgress", "Subscribed", "Suspended", "Reinstated", "Succeeded", "Failed", "Unsubscribed", "Updating")] + string OfferDetailStatus { get; } /// Offer Plan Term unit [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Offer Plan Term unit", SerializedName = @"termUnit", PossibleTypes = new [] { typeof(string) })] @@ -234,6 +269,9 @@ public partial interface IOrganizationResource : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the Confluent organization.", SerializedName = @"organizationId", PossibleTypes = new [] { typeof(string) })] @@ -242,14 +280,21 @@ public partial interface IOrganizationResource : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Provision states for confluent RP", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState) })] - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.PSArgumentCompleterAttribute("Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", "NotSpecified")] + string ProvisioningState { get; } /// SSO url for the Confluent organization. [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"SSO url for the Confluent organization.", SerializedName = @"ssoUrl", PossibleTypes = new [] { typeof(string) })] @@ -258,14 +303,20 @@ public partial interface IOrganizationResource : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Organization resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceTags) })] - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceTags Tag { get; set; } /// The type of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of the resource.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -274,6 +325,9 @@ public partial interface IOrganizationResource : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email address", SerializedName = @"emailAddress", PossibleTypes = new [] { typeof(string) })] @@ -282,6 +336,9 @@ public partial interface IOrganizationResource : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"First name", SerializedName = @"firstName", PossibleTypes = new [] { typeof(string) })] @@ -290,6 +347,9 @@ public partial interface IOrganizationResource : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Last name", SerializedName = @"lastName", PossibleTypes = new [] { typeof(string) })] @@ -309,7 +369,7 @@ internal partial interface IOrganizationResourceInternal /// The name of the resource. string Name { get; set; } /// Confluent offer detail - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetail OfferDetail { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesOfferDetail OfferDetail { get; set; } /// Offer Id string OfferDetailId { get; set; } /// Offer Plan Id @@ -319,23 +379,25 @@ internal partial interface IOrganizationResourceInternal /// Publisher Id string OfferDetailPublisherId { get; set; } /// SaaS Offer Status - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus? OfferDetailStatus { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.PSArgumentCompleterAttribute("Started", "PendingFulfillmentStart", "InProgress", "Subscribed", "Suspended", "Reinstated", "Succeeded", "Failed", "Unsubscribed", "Updating")] + string OfferDetailStatus { get; set; } /// Offer Plan Term unit string OfferDetailTermUnit { get; set; } /// Id of the Confluent organization. string OrganizationId { get; set; } /// Organization resource properties - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceProperties Property { get; set; } /// Provision states for confluent RP - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.PSArgumentCompleterAttribute("Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", "NotSpecified")] + string ProvisioningState { get; set; } /// SSO url for the Confluent organization. string SsoUrl { get; set; } /// Organization resource tags - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceTags Tag { get; set; } /// The type of the resource. string Type { get; set; } /// Subscriber detail - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetail UserDetail { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesUserDetail UserDetail { get; set; } /// Email address string UserDetailEmailAddress { get; set; } /// First name diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResource.json.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResource.json.cs similarity index 90% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResource.json.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResource.json.cs index 9fa0311e5e9b..16ed510abd80 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResource.json.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResource.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OrganizationResource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject json ? new OrganizationResource(json) : null; } @@ -77,12 +77,12 @@ internal OrganizationResource(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runti { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceProperties.FromJson(__jsonProperties) : Property;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceTags.FromJson(__jsonTags) : Tag;} - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceProperties.FromJson(__jsonProperties) : _property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceTags.FromJson(__jsonTags) : _tag;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } @@ -106,15 +106,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode ToJson return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceListResult.PowerShell.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceListResult.PowerShell.cs similarity index 69% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceListResult.PowerShell.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceListResult.PowerShell.cs index aede40a199bb..2ec65032c912 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceListResult.PowerShell.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class OrganizationResourceListResult 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.Confluent.Models.Api20200301.IOrganizationResourceListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OrganizationResourceListResult(content); } /// - /// 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.Confluent.Models.Api20200301.IOrganizationResourceListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OrganizationResourceListResult(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IO /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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 OrganizationResourceListResult(global::System.Collections.IDictionary c // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -130,11 +136,11 @@ internal OrganizationResourceListResult(global::System.Management.Automation.PSO // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -143,6 +149,18 @@ internal OrganizationResourceListResult(global::System.Management.Automation.PSO /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeAll)?.ToString(); + + 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 response of a list operation. [System.ComponentModel.TypeConverter(typeof(OrganizationResourceListResultTypeConverter))] diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceListResult.TypeConverter.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceListResult.TypeConverter.cs similarity index 96% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceListResult.TypeConverter.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceListResult.TypeConverter.cs index 67bbcb9bcd85..60b0838b8434 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceListResult.TypeConverter.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Models.Api20200301.IOrganizationResourceListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceListResult.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceListResult.cs similarity index 71% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceListResult.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceListResult.cs index 169db8840848..3b17b9ac0bc4 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceListResult.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceListResult.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.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; /// The response of a list operation. public partial class OrganizationResourceListResult : - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceListResult, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceListResult, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceListResultInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class OrganizationResourceListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource[] _value; + private System.Collections.Generic.List _value; /// Result of a list operation. [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource[] 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 OrganizationResourceListResult() @@ -41,6 +41,9 @@ public partial interface IOrganizationResourceListResult : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Link to the next set of results, if any.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IOrganizationResourceListResult : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Result of a list operation.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource) })] - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource) })] + System.Collections.Generic.List Value { get; set; } } /// The response of a list operation. @@ -62,7 +68,7 @@ internal partial interface IOrganizationResourceListResultInternal /// Link to the next set of results, if any. string NextLink { get; set; } /// Result of a list operation. - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceListResult.json.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceListResult.json.cs similarity index 89% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceListResult.json.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceListResult.json.cs index 7a2922fd36b0..228100d56eee 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceListResult.json.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OrganizationResourceListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject json ? new OrganizationResourceListResult(json) : null; } @@ -77,8 +77,8 @@ internal OrganizationResourceListResult(Microsoft.Azure.PowerShell.Cmdlets.Confl { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Models.Api20200301.IOrganizationResource) (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResource.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.Confluent.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.Confluent.Models.IOrganizationResource) (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResource.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceProperties.PowerShell.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceProperties.PowerShell.cs new file mode 100644 index 000000000000..db15e2e4b69c --- /dev/null +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceProperties.PowerShell.cs @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; + + /// Organization resource properties + [System.ComponentModel.TypeConverter(typeof(OrganizationResourcePropertiesTypeConverter))] + public partial class OrganizationResourceProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OrganizationResourceProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OrganizationResourceProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OrganizationResourceProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OfferDetailPublisherId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailPublisherId = (string) content.GetValueForProperty("OfferDetailPublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailPublisherId, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailId = (string) content.GetValueForProperty("OfferDetailId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailId, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailPlanId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailPlanId = (string) content.GetValueForProperty("OfferDetailPlanId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailPlanId, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailPlanName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailPlanName = (string) content.GetValueForProperty("OfferDetailPlanName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailPlanName, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailTermUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailTermUnit = (string) content.GetValueForProperty("OfferDetailTermUnit",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailTermUnit, global::System.Convert.ToString); + } + if (content.Contains("UserDetailFirstName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetailFirstName = (string) content.GetValueForProperty("UserDetailFirstName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetailFirstName, global::System.Convert.ToString); + } + if (content.Contains("UserDetailLastName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetailLastName = (string) content.GetValueForProperty("UserDetailLastName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetailLastName, global::System.Convert.ToString); + } + if (content.Contains("UserDetailEmailAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetailEmailAddress = (string) content.GetValueForProperty("UserDetailEmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetailEmailAddress, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailStatus = (string) content.GetValueForProperty("OfferDetailStatus",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailStatus, global::System.Convert.ToString); + } + if (content.Contains("OfferDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesOfferDetail) content.GetValueForProperty("OfferDetail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetail, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesOfferDetailTypeConverter.ConvertFrom); + } + if (content.Contains("UserDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesUserDetail) content.GetValueForProperty("UserDetail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetail, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesUserDetailTypeConverter.ConvertFrom); + } + if (content.Contains("CreatedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).CreatedTime = (global::System.DateTime?) content.GetValueForProperty("CreatedTime",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).CreatedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("OrganizationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OrganizationId = (string) content.GetValueForProperty("OrganizationId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OrganizationId, global::System.Convert.ToString); + } + if (content.Contains("SsoUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).SsoUrl = (string) content.GetValueForProperty("SsoUrl",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).SsoUrl, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OrganizationResourceProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OfferDetailPublisherId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailPublisherId = (string) content.GetValueForProperty("OfferDetailPublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailPublisherId, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailId = (string) content.GetValueForProperty("OfferDetailId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailId, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailPlanId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailPlanId = (string) content.GetValueForProperty("OfferDetailPlanId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailPlanId, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailPlanName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailPlanName = (string) content.GetValueForProperty("OfferDetailPlanName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailPlanName, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailTermUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailTermUnit = (string) content.GetValueForProperty("OfferDetailTermUnit",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailTermUnit, global::System.Convert.ToString); + } + if (content.Contains("UserDetailFirstName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetailFirstName = (string) content.GetValueForProperty("UserDetailFirstName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetailFirstName, global::System.Convert.ToString); + } + if (content.Contains("UserDetailLastName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetailLastName = (string) content.GetValueForProperty("UserDetailLastName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetailLastName, global::System.Convert.ToString); + } + if (content.Contains("UserDetailEmailAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetailEmailAddress = (string) content.GetValueForProperty("UserDetailEmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetailEmailAddress, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailStatus = (string) content.GetValueForProperty("OfferDetailStatus",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailStatus, global::System.Convert.ToString); + } + if (content.Contains("OfferDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesOfferDetail) content.GetValueForProperty("OfferDetail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetail, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesOfferDetailTypeConverter.ConvertFrom); + } + if (content.Contains("UserDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesUserDetail) content.GetValueForProperty("UserDetail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetail, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesUserDetailTypeConverter.ConvertFrom); + } + if (content.Contains("CreatedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).CreatedTime = (global::System.DateTime?) content.GetValueForProperty("CreatedTime",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).CreatedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("OrganizationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OrganizationId = (string) content.GetValueForProperty("OrganizationId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OrganizationId, global::System.Convert.ToString); + } + if (content.Contains("SsoUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).SsoUrl = (string) content.GetValueForProperty("SsoUrl",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).SsoUrl, 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.Confluent.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Organization resource properties + [System.ComponentModel.TypeConverter(typeof(OrganizationResourcePropertiesTypeConverter))] + public partial interface IOrganizationResourceProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceProperties.TypeConverter.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceProperties.TypeConverter.cs similarity index 96% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceProperties.TypeConverter.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceProperties.TypeConverter.cs index 46c03e62454a..939f6cee7bbb 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceProperties.TypeConverter.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Models.Api20200301.IOrganizationResourceProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceProperties.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceProperties.cs new file mode 100644 index 000000000000..7dc985d9ca15 --- /dev/null +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceProperties.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; + + /// Organization resource properties + public partial class OrganizationResourceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGenerated __organizationResourcePropertiesAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesAutoGenerated(); + + /// The creation time of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] + public global::System.DateTime? CreatedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).CreatedTime; } + + /// Internal Acessors for CreatedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal.CreatedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).CreatedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).CreatedTime = value; } + + /// Internal Acessors for OfferDetail + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesOfferDetail Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal.OfferDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).OfferDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).OfferDetail = value; } + + /// Internal Acessors for OfferDetailStatus + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal.OfferDetailStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).OfferDetailStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).OfferDetailStatus = value; } + + /// Internal Acessors for OrganizationId + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal.OrganizationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).OrganizationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).OrganizationId = value; } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).ProvisioningState = value; } + + /// Internal Acessors for SsoUrl + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal.SsoUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).SsoUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).SsoUrl = value; } + + /// Internal Acessors for UserDetail + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesUserDetail Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal.UserDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).UserDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).UserDetail = value; } + + /// Confluent offer detail + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesOfferDetail OfferDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).OfferDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).OfferDetail = value ?? null /* model class */; } + + /// Offer Id + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] + public string OfferDetailId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).OfferDetailId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).OfferDetailId = value ?? null; } + + /// Offer Plan Id + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] + public string OfferDetailPlanId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).OfferDetailPlanId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).OfferDetailPlanId = value ?? null; } + + /// Offer Plan Name + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] + public string OfferDetailPlanName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).OfferDetailPlanName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).OfferDetailPlanName = value ?? null; } + + /// Publisher Id + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] + public string OfferDetailPublisherId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).OfferDetailPublisherId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).OfferDetailPublisherId = value ?? null; } + + /// SaaS Offer Status + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] + public string OfferDetailStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).OfferDetailStatus; } + + /// Offer Plan Term unit + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] + public string OfferDetailTermUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).OfferDetailTermUnit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).OfferDetailTermUnit = value ?? null; } + + /// Id of the Confluent organization. + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] + public string OrganizationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).OrganizationId; } + + /// Provision states for confluent RP + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).ProvisioningState; } + + /// SSO url for the Confluent organization. + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] + public string SsoUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).SsoUrl; } + + /// Subscriber detail + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesUserDetail UserDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).UserDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).UserDetail = value ?? null /* model class */; } + + /// Email address + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] + public string UserDetailEmailAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).UserDetailEmailAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).UserDetailEmailAddress = value ?? null; } + + /// First name + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] + public string UserDetailFirstName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).UserDetailFirstName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).UserDetailFirstName = value ?? null; } + + /// Last name + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] + public string UserDetailLastName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).UserDetailLastName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)__organizationResourcePropertiesAutoGenerated).UserDetailLastName = value ?? null; } + + /// Creates an new instance. + public OrganizationResourceProperties() + { + + } + + /// 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.Confluent.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__organizationResourcePropertiesAutoGenerated), __organizationResourcePropertiesAutoGenerated); + await eventListener.AssertObjectIsValid(nameof(__organizationResourcePropertiesAutoGenerated), __organizationResourcePropertiesAutoGenerated); + } + } + /// Organization resource properties + public partial interface IOrganizationResourceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGenerated + { + + } + /// Organization resource properties + internal partial interface IOrganizationResourcePropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal + { + + } +} \ No newline at end of file diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesAutoGenerated.json.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceProperties.json.cs similarity index 82% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesAutoGenerated.json.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceProperties.json.cs index baf1271e23a4..da8a043d37b1 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesAutoGenerated.json.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceProperties.json.cs @@ -3,12 +3,12 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; /// Organization resource properties - public partial class OrganizationResourcePropertiesAutoGenerated + public partial class OrganizationResourceProperties { /// @@ -54,22 +54,22 @@ public partial class OrganizationResourcePropertiesAutoGenerated partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesAutoGenerated. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesAutoGenerated. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesAutoGenerated FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject json ? new OrganizationResourcePropertiesAutoGenerated(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject json ? new OrganizationResourceProperties(json) : null; } /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject into a new instance of . + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject into a new instance of . /// /// A Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject instance to deserialize from. - internal OrganizationResourcePropertiesAutoGenerated(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject json) + internal OrganizationResourceProperties(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); @@ -77,20 +77,18 @@ internal OrganizationResourcePropertiesAutoGenerated(Microsoft.Azure.PowerShell. { return; } - __organizationResourceProperties = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceProperties(json); + __organizationResourcePropertiesAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesAutoGenerated(json); AfterFromJson(json); } /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode serializationMode) { @@ -102,7 +100,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode ToJson { return container; } - __organizationResourceProperties?.ToJson(container, serializationMode); + __organizationResourcePropertiesAutoGenerated?.ToJson(container, serializationMode); AfterToJson(ref container); return container; } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesAutoGenerated.PowerShell.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesAutoGenerated.PowerShell.cs new file mode 100644 index 000000000000..8f55dcab70e6 --- /dev/null +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesAutoGenerated.PowerShell.cs @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; + + /// Organization resource property + [System.ComponentModel.TypeConverter(typeof(OrganizationResourcePropertiesAutoGeneratedTypeConverter))] + public partial class OrganizationResourcePropertiesAutoGenerated + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGenerated DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OrganizationResourcePropertiesAutoGenerated(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGenerated DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OrganizationResourcePropertiesAutoGenerated(content); + } + + /// + /// Creates a new instance of , deserializing the content from a + /// json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGenerated FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OrganizationResourcePropertiesAutoGenerated(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OfferDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesOfferDetail) content.GetValueForProperty("OfferDetail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetail, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesOfferDetailTypeConverter.ConvertFrom); + } + if (content.Contains("UserDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesUserDetail) content.GetValueForProperty("UserDetail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetail, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesUserDetailTypeConverter.ConvertFrom); + } + if (content.Contains("CreatedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).CreatedTime = (global::System.DateTime?) content.GetValueForProperty("CreatedTime",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).CreatedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("OrganizationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OrganizationId = (string) content.GetValueForProperty("OrganizationId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OrganizationId, global::System.Convert.ToString); + } + if (content.Contains("SsoUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).SsoUrl = (string) content.GetValueForProperty("SsoUrl",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).SsoUrl, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailPublisherId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailPublisherId = (string) content.GetValueForProperty("OfferDetailPublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailPublisherId, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailId = (string) content.GetValueForProperty("OfferDetailId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailId, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailPlanId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailPlanId = (string) content.GetValueForProperty("OfferDetailPlanId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailPlanId, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailPlanName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailPlanName = (string) content.GetValueForProperty("OfferDetailPlanName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailPlanName, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailTermUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailTermUnit = (string) content.GetValueForProperty("OfferDetailTermUnit",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailTermUnit, global::System.Convert.ToString); + } + if (content.Contains("UserDetailFirstName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetailFirstName = (string) content.GetValueForProperty("UserDetailFirstName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetailFirstName, global::System.Convert.ToString); + } + if (content.Contains("UserDetailLastName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetailLastName = (string) content.GetValueForProperty("UserDetailLastName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetailLastName, global::System.Convert.ToString); + } + if (content.Contains("UserDetailEmailAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetailEmailAddress = (string) content.GetValueForProperty("UserDetailEmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetailEmailAddress, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailStatus = (string) content.GetValueForProperty("OfferDetailStatus",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailStatus, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OrganizationResourcePropertiesAutoGenerated(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OfferDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesOfferDetail) content.GetValueForProperty("OfferDetail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetail, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesOfferDetailTypeConverter.ConvertFrom); + } + if (content.Contains("UserDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesUserDetail) content.GetValueForProperty("UserDetail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetail, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesUserDetailTypeConverter.ConvertFrom); + } + if (content.Contains("CreatedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).CreatedTime = (global::System.DateTime?) content.GetValueForProperty("CreatedTime",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).CreatedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("OrganizationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OrganizationId = (string) content.GetValueForProperty("OrganizationId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OrganizationId, global::System.Convert.ToString); + } + if (content.Contains("SsoUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).SsoUrl = (string) content.GetValueForProperty("SsoUrl",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).SsoUrl, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailPublisherId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailPublisherId = (string) content.GetValueForProperty("OfferDetailPublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailPublisherId, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailId = (string) content.GetValueForProperty("OfferDetailId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailId, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailPlanId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailPlanId = (string) content.GetValueForProperty("OfferDetailPlanId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailPlanId, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailPlanName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailPlanName = (string) content.GetValueForProperty("OfferDetailPlanName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailPlanName, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailTermUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailTermUnit = (string) content.GetValueForProperty("OfferDetailTermUnit",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailTermUnit, global::System.Convert.ToString); + } + if (content.Contains("UserDetailFirstName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetailFirstName = (string) content.GetValueForProperty("UserDetailFirstName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetailFirstName, global::System.Convert.ToString); + } + if (content.Contains("UserDetailLastName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetailLastName = (string) content.GetValueForProperty("UserDetailLastName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetailLastName, global::System.Convert.ToString); + } + if (content.Contains("UserDetailEmailAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetailEmailAddress = (string) content.GetValueForProperty("UserDetailEmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).UserDetailEmailAddress, global::System.Convert.ToString); + } + if (content.Contains("OfferDetailStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailStatus = (string) content.GetValueForProperty("OfferDetailStatus",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal)this).OfferDetailStatus, 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.Confluent.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Organization resource property + [System.ComponentModel.TypeConverter(typeof(OrganizationResourcePropertiesAutoGeneratedTypeConverter))] + public partial interface IOrganizationResourcePropertiesAutoGenerated + + { + + } +} \ No newline at end of file diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesAutoGenerated.TypeConverter.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesAutoGenerated.TypeConverter.cs similarity index 96% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesAutoGenerated.TypeConverter.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesAutoGenerated.TypeConverter.cs index 323152a8dd89..70511f1979d0 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesAutoGenerated.TypeConverter.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesAutoGenerated.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Models.Api20200301.IOrganizationResourcePropertiesAutoGenerated ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGenerated ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesAutoGenerated).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGenerated).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceProperties.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesAutoGenerated.cs similarity index 61% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceProperties.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesAutoGenerated.cs index 67952486c69d..78072f2dffc5 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceProperties.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesAutoGenerated.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.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; /// Organization resource property - public partial class OrganizationResourceProperties : - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceProperties, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal + public partial class OrganizationResourcePropertiesAutoGenerated : + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGenerated, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal { /// Backing field for property. @@ -21,56 +21,56 @@ public partial class OrganizationResourceProperties : public global::System.DateTime? CreatedTime { get => this._createdTime; } /// Internal Acessors for CreatedTime - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal.CreatedTime { get => this._createdTime; set { {_createdTime = value;} } } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal.CreatedTime { get => this._createdTime; set { {_createdTime = value;} } } /// Internal Acessors for OfferDetail - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetail Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal.OfferDetail { get => (this._offerDetail = this._offerDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OfferDetail()); set { {_offerDetail = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesOfferDetail Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal.OfferDetail { get => (this._offerDetail = this._offerDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesOfferDetail()); set { {_offerDetail = value;} } } /// Internal Acessors for OfferDetailStatus - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal.OfferDetailStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)OfferDetail).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)OfferDetail).Status = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal.OfferDetailStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)OfferDetail).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)OfferDetail).Status = value; } /// Internal Acessors for OrganizationId - string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal.OrganizationId { get => this._organizationId; set { {_organizationId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal.OrganizationId { get => this._organizationId; set { {_organizationId = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Internal Acessors for SsoUrl - string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal.SsoUrl { get => this._ssoUrl; set { {_ssoUrl = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal.SsoUrl { get => this._ssoUrl; set { {_ssoUrl = value;} } } /// Internal Acessors for UserDetail - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetail Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesInternal.UserDetail { get => (this._userDetail = this._userDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.UserDetail()); set { {_userDetail = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesUserDetail Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGeneratedInternal.UserDetail { get => (this._userDetail = this._userDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesUserDetail()); set { {_userDetail = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetail _offerDetail; + private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesOfferDetail _offerDetail; /// Confluent offer detail [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetail OfferDetail { get => (this._offerDetail = this._offerDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OfferDetail()); set => this._offerDetail = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesOfferDetail OfferDetail { get => (this._offerDetail = this._offerDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesOfferDetail()); set => this._offerDetail = value; } /// Offer Id [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string OfferDetailId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)OfferDetail).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)OfferDetail).Id = value ?? null; } + public string OfferDetailId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)OfferDetail).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)OfferDetail).Id = value ?? null; } /// Offer Plan Id [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string OfferDetailPlanId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)OfferDetail).PlanId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)OfferDetail).PlanId = value ?? null; } + public string OfferDetailPlanId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)OfferDetail).PlanId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)OfferDetail).PlanId = value ?? null; } /// Offer Plan Name [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string OfferDetailPlanName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)OfferDetail).PlanName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)OfferDetail).PlanName = value ?? null; } + public string OfferDetailPlanName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)OfferDetail).PlanName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)OfferDetail).PlanName = value ?? null; } /// Publisher Id [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string OfferDetailPublisherId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)OfferDetail).PublisherId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)OfferDetail).PublisherId = value ?? null; } + public string OfferDetailPublisherId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)OfferDetail).PublisherId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)OfferDetail).PublisherId = value ?? null; } /// SaaS Offer Status [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus? OfferDetailStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)OfferDetail).Status; } + public string OfferDetailStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)OfferDetail).Status; } /// Offer Plan Term unit [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string OfferDetailTermUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)OfferDetail).TermUnit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)OfferDetail).TermUnit = value ?? null; } + public string OfferDetailTermUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)OfferDetail).TermUnit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)OfferDetail).TermUnit = value ?? null; } /// Backing field for property. private string _organizationId; @@ -80,11 +80,11 @@ public partial class OrganizationResourceProperties : public string OrganizationId { get => this._organizationId; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState? _provisioningState; + private string _provisioningState; /// Provision states for confluent RP [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. private string _ssoUrl; @@ -94,38 +94,43 @@ public partial class OrganizationResourceProperties : public string SsoUrl { get => this._ssoUrl; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetail _userDetail; + private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesUserDetail _userDetail; /// Subscriber detail [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetail UserDetail { get => (this._userDetail = this._userDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.UserDetail()); set => this._userDetail = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesUserDetail UserDetail { get => (this._userDetail = this._userDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesUserDetail()); set => this._userDetail = value; } /// Email address [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string UserDetailEmailAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)UserDetail).EmailAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)UserDetail).EmailAddress = value ?? null; } + public string UserDetailEmailAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)UserDetail).EmailAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)UserDetail).EmailAddress = value ?? null; } /// First name [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string UserDetailFirstName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)UserDetail).FirstName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)UserDetail).FirstName = value ?? null; } + public string UserDetailFirstName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)UserDetail).FirstName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)UserDetail).FirstName = value ?? null; } /// Last name [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string UserDetailLastName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)UserDetail).LastName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)UserDetail).LastName = value ?? null; } + public string UserDetailLastName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)UserDetail).LastName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)UserDetail).LastName = value ?? null; } - /// Creates an new instance. - public OrganizationResourceProperties() + /// + /// Creates an new instance. + /// + public OrganizationResourcePropertiesAutoGenerated() { } } /// Organization resource property - public partial interface IOrganizationResourceProperties : + public partial interface IOrganizationResourcePropertiesAutoGenerated : Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IJsonSerializable { /// The creation time of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The creation time of the resource.", SerializedName = @"createdTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -134,6 +139,9 @@ public partial interface IOrganizationResourceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Offer Id", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -142,6 +150,9 @@ public partial interface IOrganizationResourceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Offer Plan Id", SerializedName = @"planId", PossibleTypes = new [] { typeof(string) })] @@ -150,6 +161,9 @@ public partial interface IOrganizationResourceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Offer Plan Name", SerializedName = @"planName", PossibleTypes = new [] { typeof(string) })] @@ -158,6 +172,9 @@ public partial interface IOrganizationResourceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Publisher Id", SerializedName = @"publisherId", PossibleTypes = new [] { typeof(string) })] @@ -166,14 +183,21 @@ public partial interface IOrganizationResourceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"SaaS Offer Status", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus? OfferDetailStatus { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.PSArgumentCompleterAttribute("Started", "PendingFulfillmentStart", "InProgress", "Subscribed", "Suspended", "Reinstated", "Succeeded", "Failed", "Unsubscribed", "Updating")] + string OfferDetailStatus { get; } /// Offer Plan Term unit [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Offer Plan Term unit", SerializedName = @"termUnit", PossibleTypes = new [] { typeof(string) })] @@ -182,6 +206,9 @@ public partial interface IOrganizationResourceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the Confluent organization.", SerializedName = @"organizationId", PossibleTypes = new [] { typeof(string) })] @@ -190,14 +217,21 @@ public partial interface IOrganizationResourceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Provision states for confluent RP", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState) })] - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.PSArgumentCompleterAttribute("Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", "NotSpecified")] + string ProvisioningState { get; } /// SSO url for the Confluent organization. [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"SSO url for the Confluent organization.", SerializedName = @"ssoUrl", PossibleTypes = new [] { typeof(string) })] @@ -206,6 +240,9 @@ public partial interface IOrganizationResourceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email address", SerializedName = @"emailAddress", PossibleTypes = new [] { typeof(string) })] @@ -214,6 +251,9 @@ public partial interface IOrganizationResourceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"First name", SerializedName = @"firstName", PossibleTypes = new [] { typeof(string) })] @@ -222,6 +262,9 @@ public partial interface IOrganizationResourceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Last name", SerializedName = @"lastName", PossibleTypes = new [] { typeof(string) })] @@ -229,13 +272,13 @@ public partial interface IOrganizationResourceProperties : } /// Organization resource property - internal partial interface IOrganizationResourcePropertiesInternal + internal partial interface IOrganizationResourcePropertiesAutoGeneratedInternal { /// The creation time of the resource. global::System.DateTime? CreatedTime { get; set; } /// Confluent offer detail - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetail OfferDetail { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesOfferDetail OfferDetail { get; set; } /// Offer Id string OfferDetailId { get; set; } /// Offer Plan Id @@ -245,17 +288,19 @@ internal partial interface IOrganizationResourcePropertiesInternal /// Publisher Id string OfferDetailPublisherId { get; set; } /// SaaS Offer Status - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus? OfferDetailStatus { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.PSArgumentCompleterAttribute("Started", "PendingFulfillmentStart", "InProgress", "Subscribed", "Suspended", "Reinstated", "Succeeded", "Failed", "Unsubscribed", "Updating")] + string OfferDetailStatus { get; set; } /// Offer Plan Term unit string OfferDetailTermUnit { get; set; } /// Id of the Confluent organization. string OrganizationId { get; set; } /// Provision states for confluent RP - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.PSArgumentCompleterAttribute("Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", "NotSpecified")] + string ProvisioningState { get; set; } /// SSO url for the Confluent organization. string SsoUrl { get; set; } /// Subscriber detail - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetail UserDetail { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesUserDetail UserDetail { get; set; } /// Email address string UserDetailEmailAddress { get; set; } /// First name diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceProperties.json.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesAutoGenerated.json.cs similarity index 85% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceProperties.json.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesAutoGenerated.json.cs index e8422bf9eaf7..e26d3579ee12 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceProperties.json.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesAutoGenerated.json.cs @@ -3,12 +3,12 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; /// Organization resource property - public partial class OrganizationResourceProperties + public partial class OrganizationResourcePropertiesAutoGenerated { /// @@ -54,22 +54,22 @@ public partial class OrganizationResourceProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGenerated. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGenerated. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesAutoGenerated FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject json ? new OrganizationResourceProperties(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject json ? new OrganizationResourcePropertiesAutoGenerated(json) : null; } /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject into a new instance of . + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject into a new instance of . /// /// A Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject instance to deserialize from. - internal OrganizationResourceProperties(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject json) + internal OrganizationResourcePropertiesAutoGenerated(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); @@ -77,23 +77,25 @@ internal OrganizationResourceProperties(Microsoft.Azure.PowerShell.Cmdlets.Confl { return; } - {_offerDetail = If( json?.PropertyT("offerDetail"), out var __jsonOfferDetail) ? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OfferDetail.FromJson(__jsonOfferDetail) : OfferDetail;} - {_userDetail = If( json?.PropertyT("userDetail"), out var __jsonUserDetail) ? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.UserDetail.FromJson(__jsonUserDetail) : UserDetail;} - {_createdTime = If( json?.PropertyT("createdTime"), out var __jsonCreatedTime) ? global::System.DateTime.TryParse((string)__jsonCreatedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedTimeValue) ? __jsonCreatedTimeValue : CreatedTime : CreatedTime;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_organizationId = If( json?.PropertyT("organizationId"), out var __jsonOrganizationId) ? (string)__jsonOrganizationId : (string)OrganizationId;} - {_ssoUrl = If( json?.PropertyT("ssoUrl"), out var __jsonSsoUrl) ? (string)__jsonSsoUrl : (string)SsoUrl;} + {_offerDetail = If( json?.PropertyT("offerDetail"), out var __jsonOfferDetail) ? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesOfferDetail.FromJson(__jsonOfferDetail) : _offerDetail;} + {_userDetail = If( json?.PropertyT("userDetail"), out var __jsonUserDetail) ? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourcePropertiesUserDetail.FromJson(__jsonUserDetail) : _userDetail;} + {_createdTime = If( json?.PropertyT("createdTime"), out var __jsonCreatedTime) ? global::System.DateTime.TryParse((string)__jsonCreatedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedTimeValue) ? __jsonCreatedTimeValue : _createdTime : _createdTime;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_organizationId = If( json?.PropertyT("organizationId"), out var __jsonOrganizationId) ? (string)__jsonOrganizationId : (string)_organizationId;} + {_ssoUrl = If( json?.PropertyT("ssoUrl"), out var __jsonSsoUrl) ? (string)__jsonSsoUrl : (string)_ssoUrl;} AfterFromJson(json); } /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode serializationMode) { @@ -107,19 +109,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode ToJson } AddIf( null != this._offerDetail ? (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode) this._offerDetail.ToJson(null,serializationMode) : null, "offerDetail" ,container.Add ); AddIf( null != this._userDetail ? (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode) this._userDetail.ToJson(null,serializationMode) : null, "userDetail" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._createdTime ? (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonString(this._createdTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdTime" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._organizationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonString(this._organizationId.ToString()) : null, "organizationId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._ssoUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonString(this._ssoUrl.ToString()) : null, "ssoUrl" ,container.Add ); } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesOfferDetail.PowerShell.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesOfferDetail.PowerShell.cs similarity index 66% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesOfferDetail.PowerShell.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesOfferDetail.PowerShell.cs index 061b3a164112..eade6997248d 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesOfferDetail.PowerShell.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesOfferDetail.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class OrganizationResourcePropertiesOfferDetail 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.Confluent.Models.Api20200301.IOrganizationResourcePropertiesOfferDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesOfferDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OrganizationResourcePropertiesOfferDetail(content); } /// - /// 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.Confluent.Models.Api20200301.IOrganizationResourcePropertiesOfferDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesOfferDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OrganizationResourcePropertiesOfferDetail(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IO /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesOfferDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesOfferDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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,33 +116,33 @@ internal OrganizationResourcePropertiesOfferDetail(global::System.Collections.ID // actually deserialize if (content.Contains("PublisherId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).PublisherId = (string) content.GetValueForProperty("PublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).PublisherId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).PublisherId = (string) content.GetValueForProperty("PublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).PublisherId, global::System.Convert.ToString); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("PlanId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).PlanId = (string) content.GetValueForProperty("PlanId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).PlanId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).PlanId = (string) content.GetValueForProperty("PlanId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).PlanId, global::System.Convert.ToString); } if (content.Contains("PlanName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).PlanName = (string) content.GetValueForProperty("PlanName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).PlanName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).PlanName = (string) content.GetValueForProperty("PlanName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).PlanName, global::System.Convert.ToString); } if (content.Contains("TermUnit")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).TermUnit = (string) content.GetValueForProperty("TermUnit",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).TermUnit, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).TermUnit = (string) content.GetValueForProperty("TermUnit",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).TermUnit, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).Status, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -149,27 +157,27 @@ internal OrganizationResourcePropertiesOfferDetail(global::System.Management.Aut // actually deserialize if (content.Contains("PublisherId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).PublisherId = (string) content.GetValueForProperty("PublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).PublisherId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).PublisherId = (string) content.GetValueForProperty("PublisherId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).PublisherId, global::System.Convert.ToString); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("PlanId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).PlanId = (string) content.GetValueForProperty("PlanId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).PlanId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).PlanId = (string) content.GetValueForProperty("PlanId",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).PlanId, global::System.Convert.ToString); } if (content.Contains("PlanName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).PlanName = (string) content.GetValueForProperty("PlanName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).PlanName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).PlanName = (string) content.GetValueForProperty("PlanName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).PlanName, global::System.Convert.ToString); } if (content.Contains("TermUnit")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).TermUnit = (string) content.GetValueForProperty("TermUnit",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).TermUnit, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).TermUnit = (string) content.GetValueForProperty("TermUnit",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).TermUnit, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)this).Status, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -178,6 +186,18 @@ internal OrganizationResourcePropertiesOfferDetail(global::System.Management.Aut /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Confluent offer detail [System.ComponentModel.TypeConverter(typeof(OrganizationResourcePropertiesOfferDetailTypeConverter))] diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesOfferDetail.TypeConverter.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesOfferDetail.TypeConverter.cs similarity index 96% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesOfferDetail.TypeConverter.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesOfferDetail.TypeConverter.cs index ae12337564c5..a55188d684c4 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesOfferDetail.TypeConverter.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesOfferDetail.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Models.Api20200301.IOrganizationResourcePropertiesOfferDetail ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesOfferDetail ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesOfferDetail).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesOfferDetail).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesOfferDetail.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesOfferDetail.cs similarity index 59% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesOfferDetail.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesOfferDetail.cs index e553458d892b..0a9878dabb39 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesOfferDetail.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesOfferDetail.cs @@ -3,48 +3,47 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; /// Confluent offer detail public partial class OrganizationResourcePropertiesOfferDetail : - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesOfferDetail, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesOfferDetailInternal, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesOfferDetail, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesOfferDetailInternal, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetail __offerDetail = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OfferDetail(); + private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetail __offerDetail = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OfferDetail(); /// Offer Id [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)__offerDetail).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)__offerDetail).Id = value ?? null; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)__offerDetail).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)__offerDetail).Id = value ?? null; } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)__offerDetail).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)__offerDetail).Status = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)__offerDetail).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)__offerDetail).Status = value; } /// Offer Plan Id [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] - public string PlanId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)__offerDetail).PlanId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)__offerDetail).PlanId = value ?? null; } + public string PlanId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)__offerDetail).PlanId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)__offerDetail).PlanId = value ?? null; } /// Offer Plan Name [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] - public string PlanName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)__offerDetail).PlanName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)__offerDetail).PlanName = value ?? null; } + public string PlanName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)__offerDetail).PlanName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)__offerDetail).PlanName = value ?? null; } /// Publisher Id [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] - public string PublisherId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)__offerDetail).PublisherId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)__offerDetail).PublisherId = value ?? null; } + public string PublisherId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)__offerDetail).PublisherId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)__offerDetail).PublisherId = value ?? null; } /// SaaS Offer Status [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)__offerDetail).Status; } + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)__offerDetail).Status; } /// Offer Plan Term unit [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] - public string TermUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)__offerDetail).TermUnit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal)__offerDetail).TermUnit = value ?? null; } + public string TermUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)__offerDetail).TermUnit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal)__offerDetail).TermUnit = value ?? null; } /// /// Creates an new instance. @@ -69,13 +68,13 @@ public OrganizationResourcePropertiesOfferDetail() /// Confluent offer detail public partial interface IOrganizationResourcePropertiesOfferDetail : Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetail + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetail { } /// Confluent offer detail internal partial interface IOrganizationResourcePropertiesOfferDetailInternal : - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOfferDetailInternal + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOfferDetailInternal { } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesOfferDetail.json.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesOfferDetail.json.cs similarity index 93% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesOfferDetail.json.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesOfferDetail.json.cs index d748ca6d23f4..5f4e55ed7843 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesOfferDetail.json.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesOfferDetail.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OrganizationResourcePropertiesOfferDetail partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesOfferDetail. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesOfferDetail. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesOfferDetail. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesOfferDetail. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesOfferDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesOfferDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject json ? new OrganizationResourcePropertiesOfferDetail(json) : null; } @@ -77,7 +77,7 @@ internal OrganizationResourcePropertiesOfferDetail(Microsoft.Azure.PowerShell.Cm { return; } - __offerDetail = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OfferDetail(json); + __offerDetail = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OfferDetail(json); AfterFromJson(json); } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesUserDetail.PowerShell.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesUserDetail.PowerShell.cs similarity index 71% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesUserDetail.PowerShell.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesUserDetail.PowerShell.cs index aa3024a3ec86..e93f98290fae 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesUserDetail.PowerShell.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesUserDetail.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class OrganizationResourcePropertiesUserDetail 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.Confluent.Models.Api20200301.IOrganizationResourcePropertiesUserDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesUserDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OrganizationResourcePropertiesUserDetail(content); } /// - /// 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.Confluent.Models.Api20200301.IOrganizationResourcePropertiesUserDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesUserDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OrganizationResourcePropertiesUserDetail(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IO /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesUserDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesUserDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -108,21 +116,21 @@ internal OrganizationResourcePropertiesUserDetail(global::System.Collections.IDi // actually deserialize if (content.Contains("FirstName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)this).FirstName = (string) content.GetValueForProperty("FirstName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)this).FirstName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)this).FirstName = (string) content.GetValueForProperty("FirstName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)this).FirstName, global::System.Convert.ToString); } if (content.Contains("LastName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)this).LastName = (string) content.GetValueForProperty("LastName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)this).LastName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)this).LastName = (string) content.GetValueForProperty("LastName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)this).LastName, global::System.Convert.ToString); } if (content.Contains("EmailAddress")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)this).EmailAddress = (string) content.GetValueForProperty("EmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)this).EmailAddress, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)this).EmailAddress = (string) content.GetValueForProperty("EmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)this).EmailAddress, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -137,15 +145,15 @@ internal OrganizationResourcePropertiesUserDetail(global::System.Management.Auto // actually deserialize if (content.Contains("FirstName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)this).FirstName = (string) content.GetValueForProperty("FirstName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)this).FirstName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)this).FirstName = (string) content.GetValueForProperty("FirstName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)this).FirstName, global::System.Convert.ToString); } if (content.Contains("LastName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)this).LastName = (string) content.GetValueForProperty("LastName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)this).LastName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)this).LastName = (string) content.GetValueForProperty("LastName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)this).LastName, global::System.Convert.ToString); } if (content.Contains("EmailAddress")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)this).EmailAddress = (string) content.GetValueForProperty("EmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)this).EmailAddress, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)this).EmailAddress = (string) content.GetValueForProperty("EmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)this).EmailAddress, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -154,6 +162,18 @@ internal OrganizationResourcePropertiesUserDetail(global::System.Management.Auto /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Subscriber detail [System.ComponentModel.TypeConverter(typeof(OrganizationResourcePropertiesUserDetailTypeConverter))] diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesUserDetail.TypeConverter.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesUserDetail.TypeConverter.cs similarity index 96% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesUserDetail.TypeConverter.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesUserDetail.TypeConverter.cs index 0ae60075fc5f..e8e10770ffb1 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesUserDetail.TypeConverter.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesUserDetail.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Models.Api20200301.IOrganizationResourcePropertiesUserDetail ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesUserDetail ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesUserDetail).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesUserDetail).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesUserDetail.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesUserDetail.cs similarity index 67% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesUserDetail.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesUserDetail.cs index 7d6d92cb1173..8e9794c21449 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesUserDetail.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesUserDetail.cs @@ -3,33 +3,32 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; /// Subscriber detail public partial class OrganizationResourcePropertiesUserDetail : - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesUserDetail, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesUserDetailInternal, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesUserDetail, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesUserDetailInternal, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetail __userDetail = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.UserDetail(); + private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetail __userDetail = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.UserDetail(); /// Email address [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] - public string EmailAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)__userDetail).EmailAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)__userDetail).EmailAddress = value ?? null; } + public string EmailAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)__userDetail).EmailAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)__userDetail).EmailAddress = value ?? null; } /// First name [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] - public string FirstName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)__userDetail).FirstName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)__userDetail).FirstName = value ?? null; } + public string FirstName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)__userDetail).FirstName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)__userDetail).FirstName = value ?? null; } /// Last name [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inherited)] - public string LastName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)__userDetail).LastName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)__userDetail).LastName = value ?? null; } + public string LastName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)__userDetail).LastName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)__userDetail).LastName = value ?? null; } /// /// Creates an new instance. @@ -54,13 +53,13 @@ public OrganizationResourcePropertiesUserDetail() /// Subscriber detail public partial interface IOrganizationResourcePropertiesUserDetail : Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetail + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetail { } /// Subscriber detail internal partial interface IOrganizationResourcePropertiesUserDetailInternal : - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal { } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesUserDetail.json.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesUserDetail.json.cs similarity index 93% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesUserDetail.json.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesUserDetail.json.cs index 086f27ff8c0e..c53cfa14b2c0 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourcePropertiesUserDetail.json.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourcePropertiesUserDetail.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OrganizationResourcePropertiesUserDetail partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesUserDetail. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesUserDetail. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesUserDetail. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesUserDetail. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourcePropertiesUserDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourcePropertiesUserDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject json ? new OrganizationResourcePropertiesUserDetail(json) : null; } @@ -77,7 +77,7 @@ internal OrganizationResourcePropertiesUserDetail(Microsoft.Azure.PowerShell.Cmd { return; } - __userDetail = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.UserDetail(json); + __userDetail = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.UserDetail(json); AfterFromJson(json); } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceTags.PowerShell.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceTags.PowerShell.cs similarity index 80% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceTags.PowerShell.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceTags.PowerShell.cs index 1f8ce3cdc6b1..14c40cbc3d18 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceTags.PowerShell.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceTags.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class OrganizationResourceTags 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.Confluent.Models.Api20200301.IOrganizationResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OrganizationResourceTags(content); } /// - /// 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.Confluent.Models.Api20200301.IOrganizationResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OrganizationResourceTags(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IO /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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,7 +115,7 @@ internal OrganizationResourceTags(global::System.Collections.IDictionary content } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -129,6 +137,18 @@ internal OrganizationResourceTags(global::System.Management.Automation.PSObject /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Organization resource tags [System.ComponentModel.TypeConverter(typeof(OrganizationResourceTagsTypeConverter))] diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceTags.TypeConverter.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceTags.TypeConverter.cs similarity index 96% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceTags.TypeConverter.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceTags.TypeConverter.cs index cf47480688b8..633037bb3bbe 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceTags.TypeConverter.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceTags.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceTags.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceTags.cs similarity index 79% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceTags.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceTags.cs index 7eb789bd561e..f76b0a0a5b8a 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceTags.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceTags.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.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; /// Organization resource tags public partial class OrganizationResourceTags : - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceTags, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceTagsInternal { /// Creates an new instance. diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceTags.dictionary.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceTags.dictionary.cs similarity index 95% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceTags.dictionary.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceTags.dictionary.cs index cd6d2f0f7219..ffdc2f64668d 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceTags.dictionary.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceTags.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.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Models.Api20200301.OrganizationResourceTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceTags.json.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceTags.json.cs similarity index 95% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceTags.json.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceTags.json.cs index 7c778db66e2d..58ceb9db7180 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceTags.json.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceTags.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OrganizationResourceTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject json ? new OrganizationResourceTags(json) : null; } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdate.PowerShell.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdate.PowerShell.cs similarity index 74% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdate.PowerShell.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdate.PowerShell.cs index e228ec5e372e..446911e01ecd 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdate.PowerShell.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdate.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class OrganizationResourceUpdate 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.Confluent.Models.Api20200301.IOrganizationResourceUpdate DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdate DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OrganizationResourceUpdate(content); } /// - /// 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.Confluent.Models.Api20200301.IOrganizationResourceUpdate DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdate DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OrganizationResourceUpdate(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IO /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdate FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdate FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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 OrganizationResourceUpdate(global::System.Collections.IDictionary conte // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceUpdateTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceUpdateTagsTypeConverter.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. @@ -126,7 +132,7 @@ internal OrganizationResourceUpdate(global::System.Management.Automation.PSObjec // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceUpdateTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceUpdateTagsTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -135,6 +141,18 @@ internal OrganizationResourceUpdate(global::System.Management.Automation.PSObjec /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Organization Resource update [System.ComponentModel.TypeConverter(typeof(OrganizationResourceUpdateTypeConverter))] diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdate.TypeConverter.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdate.TypeConverter.cs similarity index 96% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdate.TypeConverter.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdate.TypeConverter.cs index 316840afb5e3..bce763b622c4 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdate.TypeConverter.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdate.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdate ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdate ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdate).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdate).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdate.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdate.cs similarity index 66% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdate.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdate.cs index 777af465744c..ecf25213c418 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdate.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdate.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.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; /// Organization Resource update public partial class OrganizationResourceUpdate : - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdate, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdateInternal + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdate, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdateTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateTags _tag; /// ARM resource tags [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdateTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceUpdateTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceUpdateTags()); set => this._tag = value; } /// Creates an new instance. public OrganizationResourceUpdate() @@ -34,10 +34,13 @@ public partial interface IOrganizationResourceUpdate : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"ARM resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdateTags) })] - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdateTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateTags Tag { get; set; } } /// Organization Resource update @@ -45,7 +48,7 @@ internal partial interface IOrganizationResourceUpdateInternal { /// ARM resource tags - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdateTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateTags Tag { get; set; } } } \ No newline at end of file diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdate.json.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdate.json.cs similarity index 93% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdate.json.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdate.json.cs index 0cc9af2d13d2..953095161bc4 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdate.json.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdate.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OrganizationResourceUpdate partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdate. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdate. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdate. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdate. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdate FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdate FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject json ? new OrganizationResourceUpdate(json) : null; } @@ -77,7 +77,7 @@ internal OrganizationResourceUpdate(Microsoft.Azure.PowerShell.Cmdlets.Confluent { return; } - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceUpdateTags.FromJson(__jsonTags) : Tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceUpdateTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdateTags.PowerShell.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdateTags.PowerShell.cs similarity index 80% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdateTags.PowerShell.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdateTags.PowerShell.cs index 6e96ac495d34..a965ea6e4ade 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdateTags.PowerShell.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdateTags.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class OrganizationResourceUpdateTags 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.Confluent.Models.Api20200301.IOrganizationResourceUpdateTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OrganizationResourceUpdateTags(content); } /// - /// 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.Confluent.Models.Api20200301.IOrganizationResourceUpdateTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OrganizationResourceUpdateTags(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IO /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdateTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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. @@ -109,7 +115,7 @@ internal OrganizationResourceUpdateTags(global::System.Collections.IDictionary c } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -131,6 +137,18 @@ internal OrganizationResourceUpdateTags(global::System.Management.Automation.PSO /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// ARM resource tags [System.ComponentModel.TypeConverter(typeof(OrganizationResourceUpdateTagsTypeConverter))] diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdateTags.TypeConverter.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdateTags.TypeConverter.cs similarity index 96% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdateTags.TypeConverter.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdateTags.TypeConverter.cs index 9a5c1cf2e1d9..85f47ec6f9d9 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdateTags.TypeConverter.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdateTags.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Models.Api20200301.IOrganizationResourceUpdateTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdateTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdateTags.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdateTags.cs similarity index 78% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdateTags.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdateTags.cs index 183fd566820d..f81a429eb4dc 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdateTags.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdateTags.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.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; /// ARM resource tags public partial class OrganizationResourceUpdateTags : - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdateTags, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdateTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateTags, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateTagsInternal { /// Creates an new instance. diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdateTags.dictionary.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdateTags.dictionary.cs similarity index 95% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdateTags.dictionary.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdateTags.dictionary.cs index 540d66467ad5..6672c1c23066 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdateTags.dictionary.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdateTags.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.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Models.Api20200301.OrganizationResourceUpdateTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceUpdateTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdateTags.json.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdateTags.json.cs similarity index 94% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdateTags.json.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdateTags.json.cs index 45b90c4e99d3..9b21e7b21cd6 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/OrganizationResourceUpdateTags.json.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/OrganizationResourceUpdateTags.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OrganizationResourceUpdateTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdateTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdateTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdateTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject json ? new OrganizationResourceUpdateTags(json) : null; } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ResourceProviderDefaultErrorResponse.PowerShell.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/ResourceProviderDefaultErrorResponse.PowerShell.cs similarity index 61% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ResourceProviderDefaultErrorResponse.PowerShell.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/ResourceProviderDefaultErrorResponse.PowerShell.cs index 821fbfa12d5b..3416353dbad4 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ResourceProviderDefaultErrorResponse.PowerShell.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/ResourceProviderDefaultErrorResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class ResourceProviderDefaultErrorResponse 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.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ResourceProviderDefaultErrorResponse(content); } /// - /// 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.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ResourceProviderDefaultErrorResponse(content); } @@ -89,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IR /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.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,29 +113,29 @@ internal ResourceProviderDefaultErrorResponse(global::System.Collections.IDictio // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ErrorResponseBodyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ErrorResponseBodyTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponseInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponseInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponseInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ErrorResponseBodyTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ErrorResponseBodyTypeConverter.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. @@ -144,23 +150,23 @@ internal ResourceProviderDefaultErrorResponse(global::System.Management.Automati // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ErrorResponseBodyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ErrorResponseBodyTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponseInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponseInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponseInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ErrorResponseBodyTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ErrorResponseBodyTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -169,6 +175,18 @@ internal ResourceProviderDefaultErrorResponse(global::System.Management.Automati /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Default error response for resource provider [System.ComponentModel.TypeConverter(typeof(ResourceProviderDefaultErrorResponseTypeConverter))] diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ResourceProviderDefaultErrorResponse.TypeConverter.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/ResourceProviderDefaultErrorResponse.TypeConverter.cs similarity index 96% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ResourceProviderDefaultErrorResponse.TypeConverter.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/ResourceProviderDefaultErrorResponse.TypeConverter.cs index a1e75534598c..d73ac657ba0c 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ResourceProviderDefaultErrorResponse.TypeConverter.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/ResourceProviderDefaultErrorResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; @@ -109,14 +109,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ResourceProviderDefaultErrorResponse.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/ResourceProviderDefaultErrorResponse.cs similarity index 58% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ResourceProviderDefaultErrorResponse.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/ResourceProviderDefaultErrorResponse.cs index 5c83e3bbea40..0353f2cc6468 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ResourceProviderDefaultErrorResponse.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/ResourceProviderDefaultErrorResponse.cs @@ -3,53 +3,53 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; /// Default error response for resource provider public partial class ResourceProviderDefaultErrorResponse : - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponseInternal { /// Error code [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)Error).Code; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)Error).Code; } /// Error detail [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)Error).Detail; } + public System.Collections.Generic.List Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)Error).Detail; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody _error; + private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBody _error; /// Response body of Error [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ErrorResponseBody()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBody Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ErrorResponseBody()); } /// Error message [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)Error).Message; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)Error).Message; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)Error).Code = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)Error).Code = value; } /// Internal Acessors for Detail - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody[] Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponseInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)Error).Detail = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponseInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)Error).Detail = value; } /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ErrorResponseBody()); set { {_error = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBody Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ErrorResponseBody()); set { {_error = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)Error).Message = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)Error).Message = value; } /// Internal Acessors for Target - string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponseInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)Error).Target = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponseInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)Error).Target = value; } /// Error target [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Origin(Microsoft.Azure.PowerShell.Cmdlets.Confluent.PropertyOrigin.Inlined)] - public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBodyInternal)Error).Target; } + public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBodyInternal)Error).Target; } /// Creates an new instance. public ResourceProviderDefaultErrorResponse() @@ -65,6 +65,9 @@ public partial interface IResourceProviderDefaultErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error code", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -73,14 +76,20 @@ public partial interface IResourceProviderDefaultErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error detail", SerializedName = @"details", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody) })] - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody[] Detail { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBody) })] + System.Collections.Generic.List Detail { get; } /// Error message [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error message", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -89,6 +98,9 @@ public partial interface IResourceProviderDefaultErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error target", SerializedName = @"target", PossibleTypes = new [] { typeof(string) })] @@ -102,9 +114,9 @@ internal partial interface IResourceProviderDefaultErrorResponseInternal /// Error code string Code { get; set; } /// Error detail - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody[] Detail { get; set; } + System.Collections.Generic.List Detail { get; set; } /// Response body of Error - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IErrorResponseBody Error { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IErrorResponseBody Error { get; set; } /// Error message string Message { get; set; } /// Error target diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ResourceProviderDefaultErrorResponse.json.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/ResourceProviderDefaultErrorResponse.json.cs similarity index 92% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ResourceProviderDefaultErrorResponse.json.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/ResourceProviderDefaultErrorResponse.json.cs index dba6bc34b8a7..b1902ca0bdea 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/ResourceProviderDefaultErrorResponse.json.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/ResourceProviderDefaultErrorResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ResourceProviderDefaultErrorResponse partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject json ? new ResourceProviderDefaultErrorResponse(json) : null; } @@ -77,7 +77,7 @@ internal ResourceProviderDefaultErrorResponse(Microsoft.Azure.PowerShell.Cmdlets { return; } - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.ErrorResponseBody.FromJson(__jsonError) : Error;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.ErrorResponseBody.FromJson(__jsonError) : _error;} AfterFromJson(json); } @@ -101,7 +101,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode ToJson { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/UserDetail.PowerShell.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/UserDetail.PowerShell.cs similarity index 72% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/UserDetail.PowerShell.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/UserDetail.PowerShell.cs index 94e8b6cd87b0..fc5cb00b0c79 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/UserDetail.PowerShell.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/UserDetail.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class UserDetail 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.Confluent.Models.Api20200301.IUserDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new UserDetail(content); } /// - /// 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.Confluent.Models.Api20200301.IUserDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new UserDetail(content); } @@ -85,15 +93,27 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IU /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeAll)?.ToString(); + 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,21 +128,21 @@ internal UserDetail(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("FirstName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)this).FirstName = (string) content.GetValueForProperty("FirstName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)this).FirstName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)this).FirstName = (string) content.GetValueForProperty("FirstName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)this).FirstName, global::System.Convert.ToString); } if (content.Contains("LastName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)this).LastName = (string) content.GetValueForProperty("LastName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)this).LastName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)this).LastName = (string) content.GetValueForProperty("LastName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)this).LastName, global::System.Convert.ToString); } if (content.Contains("EmailAddress")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)this).EmailAddress = (string) content.GetValueForProperty("EmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)this).EmailAddress, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)this).EmailAddress = (string) content.GetValueForProperty("EmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)this).EmailAddress, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -137,15 +157,15 @@ internal UserDetail(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("FirstName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)this).FirstName = (string) content.GetValueForProperty("FirstName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)this).FirstName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)this).FirstName = (string) content.GetValueForProperty("FirstName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)this).FirstName, global::System.Convert.ToString); } if (content.Contains("LastName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)this).LastName = (string) content.GetValueForProperty("LastName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)this).LastName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)this).LastName = (string) content.GetValueForProperty("LastName",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)this).LastName, global::System.Convert.ToString); } if (content.Contains("EmailAddress")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)this).EmailAddress = (string) content.GetValueForProperty("EmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal)this).EmailAddress, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)this).EmailAddress = (string) content.GetValueForProperty("EmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal)this).EmailAddress, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/UserDetail.TypeConverter.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/UserDetail.TypeConverter.cs similarity index 97% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/UserDetail.TypeConverter.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/UserDetail.TypeConverter.cs index a6d09e4be8c5..9dbac91ddec7 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/UserDetail.TypeConverter.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/UserDetail.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Models.Api20200301.IUserDetail ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetail ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetail).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetail).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/UserDetail.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/UserDetail.cs similarity index 88% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/UserDetail.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/UserDetail.cs index ecb071d54c74..aa71dcb85e31 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/UserDetail.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/UserDetail.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.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; /// Subscriber detail public partial class UserDetail : - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetail, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetailInternal + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetail, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetailInternal { /// Backing field for property. @@ -48,6 +48,9 @@ public partial interface IUserDetail : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email address", SerializedName = @"emailAddress", PossibleTypes = new [] { typeof(string) })] @@ -56,6 +59,9 @@ public partial interface IUserDetail : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"First name", SerializedName = @"firstName", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +70,9 @@ public partial interface IUserDetail : [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Last name", SerializedName = @"lastName", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/UserDetail.json.cs b/generated/Confluent/Confluent.Autorest/generated/api/Models/UserDetail.json.cs similarity index 92% rename from generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/UserDetail.json.cs rename to generated/Confluent/Confluent.Autorest/generated/api/Models/UserDetail.json.cs index 4e3f2690d088..f5b12c90249c 100644 --- a/generated/Confluent/Confluent.Autorest/generated/api/Models/Api20200301/UserDetail.json.cs +++ b/generated/Confluent/Confluent.Autorest/generated/api/Models/UserDetail.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class UserDetail partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetail. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetail. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetail. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IUserDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetail. + public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IUserDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.JsonObject json ? new UserDetail(json) : null; } @@ -103,9 +101,9 @@ internal UserDetail(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Json.Js { return; } - {_firstName = If( json?.PropertyT("firstName"), out var __jsonFirstName) ? (string)__jsonFirstName : (string)FirstName;} - {_lastName = If( json?.PropertyT("lastName"), out var __jsonLastName) ? (string)__jsonLastName : (string)LastName;} - {_emailAddress = If( json?.PropertyT("emailAddress"), out var __jsonEmailAddress) ? (string)__jsonEmailAddress : (string)EmailAddress;} + {_firstName = If( json?.PropertyT("firstName"), out var __jsonFirstName) ? (string)__jsonFirstName : (string)_firstName;} + {_lastName = If( json?.PropertyT("lastName"), out var __jsonLastName) ? (string)__jsonLastName : (string)_lastName;} + {_emailAddress = If( json?.PropertyT("emailAddress"), out var __jsonEmailAddress) ? (string)__jsonEmailAddress : (string)_emailAddress;} AfterFromJson(json); } } diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Support/ProvisionState.Completer.cs b/generated/Confluent/Confluent.Autorest/generated/api/Support/ProvisionState.Completer.cs deleted file mode 100644 index 637889767c8f..000000000000 --- a/generated/Confluent/Confluent.Autorest/generated/api/Support/ProvisionState.Completer.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support -{ - - /// Provision states for confluent RP - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionStateTypeConverter))] - public partial struct ProvisionState : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Accepted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Accepted'", "Accepted", global::System.Management.Automation.CompletionResultType.ParameterValue, "Accepted"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Creating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Creating'", "Creating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Creating"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deleted'", "Deleted", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleted"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "NotSpecified".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'NotSpecified'", "NotSpecified", global::System.Management.Automation.CompletionResultType.ParameterValue, "NotSpecified"); - } - } - } -} \ No newline at end of file diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Support/ProvisionState.TypeConverter.cs b/generated/Confluent/Confluent.Autorest/generated/api/Support/ProvisionState.TypeConverter.cs deleted file mode 100644 index 55ddfc0a87ce..000000000000 --- a/generated/Confluent/Confluent.Autorest/generated/api/Support/ProvisionState.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.Confluent.Support -{ - - /// Provision states for confluent RP - public partial class ProvisionStateTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => ProvisionState.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/Confluent/Confluent.Autorest/generated/api/Support/ProvisionState.cs b/generated/Confluent/Confluent.Autorest/generated/api/Support/ProvisionState.cs deleted file mode 100644 index b42d1ebb9762..000000000000 --- a/generated/Confluent/Confluent.Autorest/generated/api/Support/ProvisionState.cs +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support -{ - - /// Provision states for confluent RP - public partial struct ProvisionState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState Accepted = @"Accepted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState Creating = @"Creating"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState Deleted = @"Deleted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState Deleting = @"Deleting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState NotSpecified = @"NotSpecified"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState Succeeded = @"Succeeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState Updating = @"Updating"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ProvisionState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ProvisionState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ProvisionState - /// 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.Confluent.Support.ProvisionState e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ProvisionState (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 ProvisionState && Equals((ProvisionState)obj); - } - - /// Returns hashCode for enum ProvisionState - /// 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 ProvisionState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ProvisionState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ProvisionState - /// the value to convert to an instance of . - - public static implicit operator ProvisionState(string value) - { - return new ProvisionState(value); - } - - /// Implicit operator to convert ProvisionState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState e) - { - return e._value; - } - - /// Overriding != operator for enum ProvisionState - /// 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.Confluent.Support.ProvisionState e1, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ProvisionState - /// 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.Confluent.Support.ProvisionState e1, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.ProvisionState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Support/SaaSOfferStatus.Completer.cs b/generated/Confluent/Confluent.Autorest/generated/api/Support/SaaSOfferStatus.Completer.cs deleted file mode 100644 index 2534407e9c5d..000000000000 --- a/generated/Confluent/Confluent.Autorest/generated/api/Support/SaaSOfferStatus.Completer.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support -{ - - /// SaaS Offer Status for confluent RP - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatusTypeConverter))] - public partial struct SaaSOfferStatus : - 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) || "Started".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Started'", "Started", global::System.Management.Automation.CompletionResultType.ParameterValue, "Started"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PendingFulfillmentStart".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PendingFulfillmentStart'", "PendingFulfillmentStart", global::System.Management.Automation.CompletionResultType.ParameterValue, "PendingFulfillmentStart"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "InProgress".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'InProgress'", "InProgress", global::System.Management.Automation.CompletionResultType.ParameterValue, "InProgress"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Subscribed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Subscribed'", "Subscribed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Subscribed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Suspended".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Suspended'", "Suspended", global::System.Management.Automation.CompletionResultType.ParameterValue, "Suspended"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Reinstated".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Reinstated'", "Reinstated", global::System.Management.Automation.CompletionResultType.ParameterValue, "Reinstated"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Unsubscribed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Unsubscribed'", "Unsubscribed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unsubscribed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); - } - } - } -} \ No newline at end of file diff --git a/generated/Confluent/Confluent.Autorest/generated/api/Support/SaaSOfferStatus.TypeConverter.cs b/generated/Confluent/Confluent.Autorest/generated/api/Support/SaaSOfferStatus.TypeConverter.cs deleted file mode 100644 index 040f597d0788..000000000000 --- a/generated/Confluent/Confluent.Autorest/generated/api/Support/SaaSOfferStatus.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.Confluent.Support -{ - - /// SaaS Offer Status for confluent RP - public partial class SaaSOfferStatusTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => SaaSOfferStatus.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/Confluent/Confluent.Autorest/generated/api/Support/SaaSOfferStatus.cs b/generated/Confluent/Confluent.Autorest/generated/api/Support/SaaSOfferStatus.cs deleted file mode 100644 index 7b4c94c32db5..000000000000 --- a/generated/Confluent/Confluent.Autorest/generated/api/Support/SaaSOfferStatus.cs +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support -{ - - /// SaaS Offer Status for confluent RP - public partial struct SaaSOfferStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus InProgress = @"InProgress"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus PendingFulfillmentStart = @"PendingFulfillmentStart"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus Reinstated = @"Reinstated"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus Started = @"Started"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus Subscribed = @"Subscribed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus Succeeded = @"Succeeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus Suspended = @"Suspended"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus Unsubscribed = @"Unsubscribed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus Updating = @"Updating"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to SaaSOfferStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new SaaSOfferStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type SaaSOfferStatus - /// 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.Confluent.Support.SaaSOfferStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type SaaSOfferStatus (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 SaaSOfferStatus && Equals((SaaSOfferStatus)obj); - } - - /// Returns hashCode for enum SaaSOfferStatus - /// 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 SaaSOfferStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for SaaSOfferStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to SaaSOfferStatus - /// the value to convert to an instance of . - - public static implicit operator SaaSOfferStatus(string value) - { - return new SaaSOfferStatus(value); - } - - /// Implicit operator to convert SaaSOfferStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus e) - { - return e._value; - } - - /// Overriding != operator for enum SaaSOfferStatus - /// 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.Confluent.Support.SaaSOfferStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum SaaSOfferStatus - /// 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.Confluent.Support.SaaSOfferStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support.SaaSOfferStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Confluent/Confluent.Autorest/generated/cmdlets/GetAzConfluentMarketplaceAgreement_List.cs b/generated/Confluent/Confluent.Autorest/generated/cmdlets/GetAzConfluentMarketplaceAgreement_List.cs index 62ed5a3f1c98..ea271d60d417 100644 --- a/generated/Confluent/Confluent.Autorest/generated/cmdlets/GetAzConfluentMarketplaceAgreement_List.cs +++ b/generated/Confluent/Confluent.Autorest/generated/cmdlets/GetAzConfluentMarketplaceAgreement_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Cmdlets; using System; /// List Confluent marketplace agreements in the subscription. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Confluent/agreements" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConfluentMarketplaceAgreement_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Description(@"List Confluent marketplace agreements in the subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Confluent/agreements", ApiVersion = "2020-03-01")] public partial class GetAzConfluentMarketplaceAgreement_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzConfluentMarketplaceAgreement_List : global::System.Ma /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Confluent Client => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzConfluentMarketplaceAgreement_List : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -84,7 +105,7 @@ public partial class GetAzConfluentMarketplaceAgreement_List : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -116,7 +137,8 @@ public partial class GetAzConfluentMarketplaceAgreement_List : global::System.Ma [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -125,24 +147,24 @@ public partial class GetAzConfluentMarketplaceAgreement_List : global::System.Ma /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceListResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceListResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, 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.Confluent.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -186,7 +213,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzConfluentMarketplaceAgreement_List() { @@ -237,8 +264,33 @@ public GetAzConfluentMarketplaceAgreement_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.Confluent.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -291,7 +343,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -312,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -350,12 +402,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -372,15 +424,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -390,12 +442,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IConfluentAgreementResourceListResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceListResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -407,15 +459,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentAgreementResourceListResponse + 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/Confluent/Confluent.Autorest/generated/cmdlets/GetAzConfluentOrganizationOperation_List.cs b/generated/Confluent/Confluent.Autorest/generated/cmdlets/GetAzConfluentOrganizationOperation_List.cs index 9de430dc28b6..ce28e378f821 100644 --- a/generated/Confluent/Confluent.Autorest/generated/cmdlets/GetAzConfluentOrganizationOperation_List.cs +++ b/generated/Confluent/Confluent.Autorest/generated/cmdlets/GetAzConfluentOrganizationOperation_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Cmdlets; using System; /// List all operations provided by Microsoft.Confluent. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConfluentOrganizationOperation_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResult))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResult))] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Description(@"List all operations provided by Microsoft.Confluent.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.HttpPath(Path = "/providers/Microsoft.Confluent/operations", ApiVersion = "2020-03-01")] public partial class GetAzConfluentOrganizationOperation_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.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 GetAzConfluentOrganizationOperation_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.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Confluent Client => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.ClientAPI; @@ -59,6 +77,9 @@ public partial class GetAzConfluentOrganizationOperation_List : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.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 GetAzConfluentOrganizationOperation_List : global::System.M /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.HttpPipeline Pipeline { get; set; } /// The URI 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 GetAzConfluentOrganizationOperation_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.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.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 GetAzConfluentOrganizationOperation_List() { @@ -220,8 +246,33 @@ public GetAzConfluentOrganizationOperation_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.Confluent.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -292,7 +343,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.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.Confluent.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.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.Confluent.Models.Api20200301.IOperationListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.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/Confluent/Confluent.Autorest/generated/cmdlets/GetAzConfluentOrganization_Get.cs b/generated/Confluent/Confluent.Autorest/generated/cmdlets/GetAzConfluentOrganization_Get.cs index 8f2f01afc735..7aa67979e87c 100644 --- a/generated/Confluent/Confluent.Autorest/generated/cmdlets/GetAzConfluentOrganization_Get.cs +++ b/generated/Confluent/Confluent.Autorest/generated/cmdlets/GetAzConfluentOrganization_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Cmdlets; using System; /// Get the properties of a specific Organization resource. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConfluentOrganization_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Description(@"Get the properties of a specific Organization resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}", ApiVersion = "2020-03-01")] public partial class GetAzConfluentOrganization_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzConfluentOrganization_Get : global::System.Management. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Confluent Client => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzConfluentOrganization_Get : global::System.Management. [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.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 GetAzConfluentOrganization_Get : global::System.Management. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -139,7 +160,8 @@ public partial class GetAzConfluentOrganization_Get : global::System.Management. [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -148,24 +170,24 @@ public partial class GetAzConfluentOrganization_Get : global::System.Management. /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -188,6 +210,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -209,7 +236,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzConfluentOrganization_Get() { @@ -260,8 +287,33 @@ public GetAzConfluentOrganization_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.Confluent.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -314,7 +366,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -335,7 +387,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -373,12 +425,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -395,15 +447,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -413,12 +465,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -430,8 +482,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource + var result = (await response); + 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/Confluent/Confluent.Autorest/generated/cmdlets/GetAzConfluentOrganization_GetViaIdentity.cs b/generated/Confluent/Confluent.Autorest/generated/cmdlets/GetAzConfluentOrganization_GetViaIdentity.cs index bf8a4a4c0841..5c54657fe703 100644 --- a/generated/Confluent/Confluent.Autorest/generated/cmdlets/GetAzConfluentOrganization_GetViaIdentity.cs +++ b/generated/Confluent/Confluent.Autorest/generated/cmdlets/GetAzConfluentOrganization_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Cmdlets; using System; /// Get the properties of a specific Organization resource. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConfluentOrganization_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Description(@"Get the properties of a specific Organization resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}", ApiVersion = "2020-03-01")] public partial class GetAzConfluentOrganization_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzConfluentOrganization_GetViaIdentity : global::System. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Confluent Client => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzConfluentOrganization_GetViaIdentity : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -86,7 +107,7 @@ public partial class GetAzConfluentOrganization_GetViaIdentity : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -109,24 +130,24 @@ public partial class GetAzConfluentOrganization_GetViaIdentity : global::System. /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -149,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -170,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzConfluentOrganization_GetViaIdentity() { @@ -221,8 +247,33 @@ public GetAzConfluentOrganization_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.Confluent.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -313,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -351,12 +402,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -373,7 +424,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -391,12 +442,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -408,8 +459,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource + var result = (await response); + 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/Confluent/Confluent.Autorest/generated/cmdlets/GetAzConfluentOrganization_List.cs b/generated/Confluent/Confluent.Autorest/generated/cmdlets/GetAzConfluentOrganization_List.cs index 9226a3c1fc9d..df47d56548be 100644 --- a/generated/Confluent/Confluent.Autorest/generated/cmdlets/GetAzConfluentOrganization_List.cs +++ b/generated/Confluent/Confluent.Autorest/generated/cmdlets/GetAzConfluentOrganization_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Cmdlets; using System; /// List all organizations under the specified subscription. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Confluent/organizations" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConfluentOrganization_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Description(@"List all organizations under the specified subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Confluent/organizations", ApiVersion = "2020-03-01")] public partial class GetAzConfluentOrganization_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzConfluentOrganization_List : global::System.Management /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Confluent Client => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzConfluentOrganization_List : global::System.Management [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -84,7 +105,7 @@ public partial class GetAzConfluentOrganization_List : global::System.Management /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -116,7 +137,8 @@ public partial class GetAzConfluentOrganization_List : global::System.Management [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -125,24 +147,24 @@ public partial class GetAzConfluentOrganization_List : global::System.Management /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceListResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, 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.Confluent.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -186,7 +213,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzConfluentOrganization_List() { @@ -237,8 +264,33 @@ public GetAzConfluentOrganization_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.Confluent.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -291,7 +343,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -312,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -350,12 +402,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -372,15 +424,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -390,12 +442,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceListResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -407,15 +459,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceListResult + 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/Confluent/Confluent.Autorest/generated/cmdlets/GetAzConfluentOrganization_List1.cs b/generated/Confluent/Confluent.Autorest/generated/cmdlets/GetAzConfluentOrganization_List1.cs index 636022ff332f..5b9ef37b5b30 100644 --- a/generated/Confluent/Confluent.Autorest/generated/cmdlets/GetAzConfluentOrganization_List1.cs +++ b/generated/Confluent/Confluent.Autorest/generated/cmdlets/GetAzConfluentOrganization_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Cmdlets; using System; /// List all Organizations under the specified resource group. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConfluentOrganization_List1")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Description(@"List all Organizations under the specified resource group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations", ApiVersion = "2020-03-01")] public partial class GetAzConfluentOrganization_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzConfluentOrganization_List1 : global::System.Managemen /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Confluent Client => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzConfluentOrganization_List1 : global::System.Managemen [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -84,7 +105,7 @@ public partial class GetAzConfluentOrganization_List1 : global::System.Managemen /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -130,7 +151,8 @@ public partial class GetAzConfluentOrganization_List1 : global::System.Managemen [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -139,24 +161,24 @@ public partial class GetAzConfluentOrganization_List1 : global::System.Managemen /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceListResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -179,6 +201,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -200,7 +227,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzConfluentOrganization_List1() { @@ -251,8 +278,33 @@ public GetAzConfluentOrganization_List1() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -305,7 +357,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -326,7 +378,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -364,12 +416,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -386,15 +438,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -404,12 +456,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceListResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -421,15 +473,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceListResult + 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/Confluent/Confluent.Autorest/generated/cmdlets/NewAzConfluentOrganization_CreateExpanded.cs b/generated/Confluent/Confluent.Autorest/generated/cmdlets/NewAzConfluentOrganization_CreateExpanded.cs index 82e5557bddef..37289f7bba9d 100644 --- a/generated/Confluent/Confluent.Autorest/generated/cmdlets/NewAzConfluentOrganization_CreateExpanded.cs +++ b/generated/Confluent/Confluent.Autorest/generated/cmdlets/NewAzConfluentOrganization_CreateExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Cmdlets; using System; - /// Create Organization resource + /// create Organization resource /// /// [OpenAPI] Create=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzConfluentOrganization_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Description(@"Create Organization resource")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Description(@"create Organization resource")] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}", ApiVersion = "2020-03-01")] public partial class NewAzConfluentOrganization_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -30,13 +33,25 @@ public partial class NewAzConfluentOrganization_CreateExpanded : global::System. private string __processRecordId; /// Organization resource. - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource _body = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResource(); + private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource _body = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResource(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object 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.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] @@ -47,6 +62,9 @@ public partial class NewAzConfluentOrganization_CreateExpanded : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Confluent Client => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.ClientAPI; @@ -60,6 +78,9 @@ public partial class NewAzConfluentOrganization_CreateExpanded : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -175,7 +196,7 @@ public partial class NewAzConfluentOrganization_CreateExpanded : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -221,7 +242,8 @@ public partial class NewAzConfluentOrganization_CreateExpanded : global::System. [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -234,8 +256,8 @@ public partial class NewAzConfluentOrganization_CreateExpanded : global::System. ReadOnly = false, Description = @"Organization resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } /// Email address [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Email address")] @@ -275,24 +297,24 @@ public partial class NewAzConfluentOrganization_CreateExpanded : global::System. /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -339,6 +361,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets.NewAzConfluentOrgani /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -403,11 +430,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.Confluent.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"); @@ -419,10 +471,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -432,7 +500,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzConfluentOrganization_CreateExpanded() { @@ -498,7 +566,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -511,12 +579,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.OrganizationCreate(SubscriptionId, ResourceGroupName, Name, _body, onOk, onDefault, this, Pipeline); + await this.Client.OrganizationCreate(SubscriptionId, ResourceGroupName, Name, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -554,12 +622,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -576,15 +644,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -594,12 +662,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -611,8 +679,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource + var result = (await response); + 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/Confluent/Confluent.Autorest/generated/cmdlets/NewAzConfluentOrganization_CreateViaJsonFilePath.cs b/generated/Confluent/Confluent.Autorest/generated/cmdlets/NewAzConfluentOrganization_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..7ac125404a09 --- /dev/null +++ b/generated/Confluent/Confluent.Autorest/generated/cmdlets/NewAzConfluentOrganization_CreateViaJsonFilePath.cs @@ -0,0 +1,607 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Cmdlets; + using System; + + /// create Organization resource + /// + /// [OpenAPI] Create=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzConfluentOrganization_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Description(@"create Organization resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}", ApiVersion = "2020-03-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.NotSuggestDefaultParameterSet] + public partial class NewAzConfluentOrganization_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.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; + + /// 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.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Confluent Client => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Organization resource name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Organization resource name")] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Organization resource name", + SerializedName = @"organizationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("OrganizationName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// Resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Microsoft Azure subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Microsoft Azure subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Microsoft Azure subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzConfluentOrganization_CreateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets.NewAzConfluentOrganization_CreateViaJsonFilePath Clone() + { + var clone = new NewAzConfluentOrganization_CreateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.JsonFilePath = this.JsonFilePath; + 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.Confluent.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"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.Confluent.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.Confluent.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.Confluent.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.Confluent.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Confluent.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 NewAzConfluentOrganization_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'OrganizationCreate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OrganizationCreateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.Confluent.Models.IOrganizationResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource + var result = (await response); + 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/Confluent/Confluent.Autorest/generated/cmdlets/NewAzConfluentOrganization_CreateViaJsonString.cs b/generated/Confluent/Confluent.Autorest/generated/cmdlets/NewAzConfluentOrganization_CreateViaJsonString.cs new file mode 100644 index 000000000000..b28e5599ea8b --- /dev/null +++ b/generated/Confluent/Confluent.Autorest/generated/cmdlets/NewAzConfluentOrganization_CreateViaJsonString.cs @@ -0,0 +1,605 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Cmdlets; + using System; + + /// create Organization resource + /// + /// [OpenAPI] Create=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzConfluentOrganization_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Description(@"create Organization resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}", ApiVersion = "2020-03-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.NotSuggestDefaultParameterSet] + public partial class NewAzConfluentOrganization_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.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; + + /// 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.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Confluent Client => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Organization resource name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Organization resource name")] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Organization resource name", + SerializedName = @"organizationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("OrganizationName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// Resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Microsoft Azure subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Microsoft Azure subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Microsoft Azure subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzConfluentOrganization_CreateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets.NewAzConfluentOrganization_CreateViaJsonString Clone() + { + var clone = new NewAzConfluentOrganization_CreateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.JsonString = this.JsonString; + 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.Confluent.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"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.Confluent.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.Confluent.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.Confluent.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.Confluent.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Confluent.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 NewAzConfluentOrganization_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'OrganizationCreate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OrganizationCreateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.Confluent.Models.IOrganizationResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource + var result = (await response); + 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/Confluent/Confluent.Autorest/generated/cmdlets/RemoveAzConfluentOrganization_Delete.cs b/generated/Confluent/Confluent.Autorest/generated/cmdlets/RemoveAzConfluentOrganization_Delete.cs index c73a72ba7244..dfce40531ac8 100644 --- a/generated/Confluent/Confluent.Autorest/generated/cmdlets/RemoveAzConfluentOrganization_Delete.cs +++ b/generated/Confluent/Confluent.Autorest/generated/cmdlets/RemoveAzConfluentOrganization_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Cmdlets; using System; /// Delete Organization resource @@ -19,7 +21,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}", ApiVersion = "2020-03-01")] public partial class RemoveAzConfluentOrganization_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.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 RemoveAzConfluentOrganization_Delete : global::System.Manag /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object 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.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] @@ -45,6 +60,9 @@ public partial class RemoveAzConfluentOrganization_Delete : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Confluent Client => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class RemoveAzConfluentOrganization_Delete : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.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 RemoveAzConfluentOrganization_Delete : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -160,7 +181,8 @@ public partial class RemoveAzConfluentOrganization_Delete : global::System.Manag [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -169,12 +191,12 @@ public partial class RemoveAzConfluentOrganization_Delete : global::System.Manag /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.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 @@ -240,6 +262,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets.RemoveAzConfluentOrg /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -304,11 +331,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.Confluent.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"); @@ -320,10 +372,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -391,7 +459,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -409,7 +477,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -422,7 +490,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzConfluentOrganization_Delete() { @@ -455,12 +523,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -477,15 +545,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Confluent/Confluent.Autorest/generated/cmdlets/RemoveAzConfluentOrganization_DeleteViaIdentity.cs b/generated/Confluent/Confluent.Autorest/generated/cmdlets/RemoveAzConfluentOrganization_DeleteViaIdentity.cs index 75e33d57e320..9ea78a3a5bd4 100644 --- a/generated/Confluent/Confluent.Autorest/generated/cmdlets/RemoveAzConfluentOrganization_DeleteViaIdentity.cs +++ b/generated/Confluent/Confluent.Autorest/generated/cmdlets/RemoveAzConfluentOrganization_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Cmdlets; using System; /// Delete Organization resource @@ -19,7 +21,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}", ApiVersion = "2020-03-01")] public partial class RemoveAzConfluentOrganization_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.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 RemoveAzConfluentOrganization_DeleteViaIdentity : global::S /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object 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.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] @@ -45,6 +60,9 @@ public partial class RemoveAzConfluentOrganization_DeleteViaIdentity : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Confluent Client => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class RemoveAzConfluentOrganization_DeleteViaIdentity : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.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 RemoveAzConfluentOrganization_DeleteViaIdentity : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.HttpPipeline Pipeline { get; set; } /// The URI 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 RemoveAzConfluentOrganization_DeleteViaIdentity : global::S /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.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.Confluent.Cmdlets.RemoveAzConfluentOrg /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "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.Confluent.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.Confluent.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -387,7 +454,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Confluent.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 } }); @@ -400,7 +467,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzConfluentOrganization_DeleteViaIdentity() { @@ -433,12 +500,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -455,7 +522,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.Confluent.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.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/Confluent/Confluent.Autorest/generated/cmdlets/UpdateAzConfluentOrganization_UpdateExpanded.cs b/generated/Confluent/Confluent.Autorest/generated/cmdlets/UpdateAzConfluentOrganization_UpdateExpanded.cs index b953da880108..bea0d6217998 100644 --- a/generated/Confluent/Confluent.Autorest/generated/cmdlets/UpdateAzConfluentOrganization_UpdateExpanded.cs +++ b/generated/Confluent/Confluent.Autorest/generated/cmdlets/UpdateAzConfluentOrganization_UpdateExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Cmdlets; using System; - /// Update Organization resource + /// update Organization resource /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzConfluentOrganization_UpdateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Description(@"Update Organization resource")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Description(@"update Organization resource")] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}", ApiVersion = "2020-03-01")] public partial class UpdateAzConfluentOrganization_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -30,18 +33,33 @@ public partial class UpdateAzConfluentOrganization_UpdateExpanded : global::Syst private string __processRecordId; /// Organization Resource update - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdate _body = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceUpdate(); + private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdate _body = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceUpdate(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Confluent Client => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.ClientAPI; @@ -55,6 +73,9 @@ public partial class UpdateAzConfluentOrganization_UpdateExpanded : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -96,7 +117,7 @@ public partial class UpdateAzConfluentOrganization_UpdateExpanded : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -142,7 +163,8 @@ public partial class UpdateAzConfluentOrganization_UpdateExpanded : global::Syst [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -155,32 +177,32 @@ public partial class UpdateAzConfluentOrganization_UpdateExpanded : global::Syst ReadOnly = false, Description = @"ARM resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdateTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdateTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -203,6 +225,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -267,8 +294,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -324,7 +376,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -337,12 +389,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.OrganizationUpdate(SubscriptionId, ResourceGroupName, Name, _body, onOk, onDefault, this, Pipeline); + await this.Client.OrganizationUpdate(SubscriptionId, ResourceGroupName, Name, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -362,7 +414,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzConfluentOrganization_UpdateExpanded() { @@ -388,12 +440,12 @@ public UpdateAzConfluentOrganization_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.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -410,15 +462,15 @@ public UpdateAzConfluentOrganization_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -428,12 +480,12 @@ public UpdateAzConfluentOrganization_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.Confluent.Models.Api20200301.IOrganizationResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -445,8 +497,26 @@ public UpdateAzConfluentOrganization_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource + var result = (await response); + 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/Confluent/Confluent.Autorest/generated/cmdlets/UpdateAzConfluentOrganization_UpdateViaIdentityExpanded.cs b/generated/Confluent/Confluent.Autorest/generated/cmdlets/UpdateAzConfluentOrganization_UpdateViaIdentityExpanded.cs index 9a937337f3a6..01e663a19b35 100644 --- a/generated/Confluent/Confluent.Autorest/generated/cmdlets/UpdateAzConfluentOrganization_UpdateViaIdentityExpanded.cs +++ b/generated/Confluent/Confluent.Autorest/generated/cmdlets/UpdateAzConfluentOrganization_UpdateViaIdentityExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Cmdlets; using System; - /// Update Organization resource + /// update Organization resource /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzConfluentOrganization_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Description(@"Update Organization resource")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Description(@"update Organization resource")] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}", ApiVersion = "2020-03-01")] public partial class UpdateAzConfluentOrganization_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -30,18 +33,33 @@ public partial class UpdateAzConfluentOrganization_UpdateViaIdentityExpanded : g private string __processRecordId; /// Organization Resource update - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdate _body = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.OrganizationResourceUpdate(); + private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdate _body = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.OrganizationResourceUpdate(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Confluent Client => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.ClientAPI; @@ -55,6 +73,9 @@ public partial class UpdateAzConfluentOrganization_UpdateViaIdentityExpanded : g [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -89,7 +110,7 @@ public partial class UpdateAzConfluentOrganization_UpdateViaIdentityExpanded : g /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -116,32 +137,32 @@ public partial class UpdateAzConfluentOrganization_UpdateViaIdentityExpanded : g ReadOnly = false, Description = @"ARM resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdateTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResourceUpdateTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceUpdateTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, 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.Confluent.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -228,8 +254,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -285,7 +336,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -300,7 +351,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.OrganizationUpdateViaIdentity(InputObject.Id, _body, onOk, onDefault, this, Pipeline); + await this.Client.OrganizationUpdateViaIdentity(InputObject.Id, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeUpdate); } else { @@ -317,13 +368,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.OrganizationName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.OrganizationUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.OrganizationName ?? null, _body, onOk, onDefault, this, Pipeline); + await this.Client.OrganizationUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.OrganizationName ?? null, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -343,7 +394,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzConfluentOrganization_UpdateViaIdentityExpanded() { @@ -369,12 +420,12 @@ public UpdateAzConfluentOrganization_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.Confluent.Models.Api20200301.IResourceProviderDefaultErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -391,15 +442,15 @@ public UpdateAzConfluentOrganization_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -409,12 +460,12 @@ public UpdateAzConfluentOrganization_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.Confluent.Models.Api20200301.IOrganizationResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -426,8 +477,26 @@ public UpdateAzConfluentOrganization_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOrganizationResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource + var result = (await response); + 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/Confluent/Confluent.Autorest/generated/cmdlets/UpdateAzConfluentOrganization_UpdateViaJsonFilePath.cs b/generated/Confluent/Confluent.Autorest/generated/cmdlets/UpdateAzConfluentOrganization_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..4ed31c30ae9b --- /dev/null +++ b/generated/Confluent/Confluent.Autorest/generated/cmdlets/UpdateAzConfluentOrganization_UpdateViaJsonFilePath.cs @@ -0,0 +1,524 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Cmdlets; + using System; + + /// update Organization resource + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzConfluentOrganization_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Description(@"update Organization resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}", ApiVersion = "2020-03-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.NotSuggestDefaultParameterSet] + public partial class UpdateAzConfluentOrganization_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Confluent Client => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Update operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Organization resource name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Organization resource name")] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Organization resource name", + SerializedName = @"organizationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("OrganizationName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// Resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Microsoft Azure subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Microsoft Azure subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Microsoft Azure subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"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.Confluent.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'OrganizationUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OrganizationUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzConfluentOrganization_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.Confluent.Models.IOrganizationResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource + var result = (await response); + 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/Confluent/Confluent.Autorest/generated/cmdlets/UpdateAzConfluentOrganization_UpdateViaJsonString.cs b/generated/Confluent/Confluent.Autorest/generated/cmdlets/UpdateAzConfluentOrganization_UpdateViaJsonString.cs new file mode 100644 index 000000000000..6be17a1d2cb1 --- /dev/null +++ b/generated/Confluent/Confluent.Autorest/generated/cmdlets/UpdateAzConfluentOrganization_UpdateViaJsonString.cs @@ -0,0 +1,522 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Cmdlets; + using System; + + /// update Organization resource + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzConfluentOrganization_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Description(@"update Organization resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}", ApiVersion = "2020-03-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.NotSuggestDefaultParameterSet] + public partial class UpdateAzConfluentOrganization_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Confluent Client => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Update operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Organization resource name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Organization resource name")] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Organization resource name", + SerializedName = @"organizationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("OrganizationName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// Resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Microsoft Azure subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Microsoft Azure subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Microsoft Azure subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Confluent.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.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.Confluent.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"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.Confluent.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'OrganizationUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OrganizationUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzConfluentOrganization_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Confluent.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IResourceProviderDefaultErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.Confluent.Models.IOrganizationResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource + var result = (await response); + 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/Confluent/Confluent.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs b/generated/Confluent/Confluent.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs new file mode 100644 index 000000000000..7a771114ab45 --- /dev/null +++ b/generated/Confluent/Confluent.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.Confluent +{ + 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/Confluent/Confluent.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs b/generated/Confluent/Confluent.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs new file mode 100644 index 000000000000..81acb41bc180 --- /dev/null +++ b/generated/Confluent/Confluent.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.Confluent +{ + 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/Confluent/Confluent.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs index 40f8ec49f7e9..c91f07283534 100644 --- a/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +++ b/generated/Confluent/Confluent.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.Confluent.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Confluent.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/Confluent/Confluent.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs index f3d1e20e63f0..50da453892ab 100644 --- a/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs +++ b/generated/Confluent/Confluent.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.Confluent.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Confluent.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; protected override void ProcessRecord() { diff --git a/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index 16ebaf4fcaed..9b1ec58dcbf0 100644 --- a/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/generated/Confluent/Confluent.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/Confluent/Confluent.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs index 5da657fabc9b..872b60350bff 100644 --- a/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs +++ b/generated/Confluent/Confluent.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/Confluent/Confluent.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs index 572de8abea1e..46b2c8b6dc0a 100644 --- a/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs +++ b/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -12,50 +12,96 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.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/Confluent/Confluent.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs b/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs index 6bbb9ff6dcdc..fcfa23495e87 100644 --- a/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs +++ b/generated/Confluent/Confluent.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/Confluent/Confluent.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs index 1a1101fcfea5..6121599700a1 100644 --- a/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs +++ b/generated/Confluent/Confluent.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/Confluent/Confluent.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index 9df08222afb9..06d7f635dcee 100644 --- a/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/Confluent/Confluent.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.Confluent.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.Confluent.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.Confluent.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/Confluent/Confluent.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs index 073e018430c7..4c982253b315 100644 --- a/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs +++ b/generated/Confluent/Confluent.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/Confluent/Confluent.Autorest/generated/runtime/BuildTime/PsAttributes.cs b/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/PsAttributes.cs index 1788c5f5c30e..d8a3492d63cd 100644 --- a/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/PsAttributes.cs +++ b/generated/Confluent/Confluent.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/Confluent/Confluent.Autorest/generated/runtime/BuildTime/PsExtensions.cs b/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/PsExtensions.cs index 31637e66132c..819ec64b752f 100644 --- a/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/PsExtensions.cs +++ b/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/PsExtensions.cs @@ -13,6 +13,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.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/Confluent/Confluent.Autorest/generated/runtime/BuildTime/PsHelpers.cs b/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/PsHelpers.cs index b17e31e120d0..d346806c58c6 100644 --- a/generated/Confluent/Confluent.Autorest/generated/runtime/BuildTime/PsHelpers.cs +++ b/generated/Confluent/Confluent.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/Confluent/Confluent.Autorest/generated/runtime/Context.cs b/generated/Confluent/Confluent.Autorest/generated/runtime/Context.cs new file mode 100644 index 000000000000..36d2b3172418 --- /dev/null +++ b/generated/Confluent/Confluent.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.Confluent.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.Confluent.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.Confluent.Confluent Client { get; } + } +} diff --git a/generated/Confluent/Confluent.Autorest/generated/runtime/Events.cs b/generated/Confluent/Confluent.Autorest/generated/runtime/Events.cs index e946a683df5f..aedf30cc79b5 100644 --- a/generated/Confluent/Confluent.Autorest/generated/runtime/Events.cs +++ b/generated/Confluent/Confluent.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/Confluent/Confluent.Autorest/generated/runtime/ISendAsync.cs b/generated/Confluent/Confluent.Autorest/generated/runtime/ISendAsync.cs index 9cfc5b379899..3dceec4713f8 100644 --- a/generated/Confluent/Confluent.Autorest/generated/runtime/ISendAsync.cs +++ b/generated/Confluent/Confluent.Autorest/generated/runtime/ISendAsync.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Confluent.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/Confluent/Confluent.Autorest/generated/runtime/InfoAttribute.cs b/generated/Confluent/Confluent.Autorest/generated/runtime/InfoAttribute.cs index e3608980929d..920c779b3278 100644 --- a/generated/Confluent/Confluent.Autorest/generated/runtime/InfoAttribute.cs +++ b/generated/Confluent/Confluent.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/Confluent/Confluent.Autorest/generated/runtime/InputHandler.cs b/generated/Confluent/Confluent.Autorest/generated/runtime/InputHandler.cs new file mode 100644 index 000000000000..e2b4d265cc0c --- /dev/null +++ b/generated/Confluent/Confluent.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.Confluent.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.Confluent.Runtime.IContext context); + } +} \ No newline at end of file diff --git a/generated/Confluent/Confluent.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs b/generated/Confluent/Confluent.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs index b366d846d07a..d8732a0c1af8 100644 --- a/generated/Confluent/Confluent.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs +++ b/generated/Confluent/Confluent.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/Confluent/Confluent.Autorest/generated/runtime/SerializationMode.cs b/generated/Confluent/Confluent.Autorest/generated/runtime/SerializationMode.cs index 6a247a8a4f8b..81abd4a8145a 100644 --- a/generated/Confluent/Confluent.Autorest/generated/runtime/SerializationMode.cs +++ b/generated/Confluent/Confluent.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/Confluent/Confluent.Autorest/generated/runtime/TypeConverterExtensions.cs b/generated/Confluent/Confluent.Autorest/generated/runtime/TypeConverterExtensions.cs index 37c201022788..8d8a2a652646 100644 --- a/generated/Confluent/Confluent.Autorest/generated/runtime/TypeConverterExtensions.cs +++ b/generated/Confluent/Confluent.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/Confluent/Confluent.Autorest/internal/Get-AzConfluentOrganizationOperation.ps1 b/generated/Confluent/Confluent.Autorest/internal/Get-AzConfluentOrganizationOperation.ps1 index 1e504a207413..bf6999102e5e 100644 --- a/generated/Confluent/Confluent.Autorest/internal/Get-AzConfluentOrganizationOperation.ps1 +++ b/generated/Confluent/Confluent.Autorest/internal/Get-AzConfluentOrganizationOperation.ps1 @@ -25,12 +25,12 @@ List all operations provided by Microsoft.Confluent. {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResult +Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResult .Link https://learn.microsoft.com/powershell/module/az.confluent/get-azconfluentorganizationoperation #> function Get-AzConfluentOrganizationOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResult])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResult])] [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.Confluent.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.Confluent.private\Get-AzConfluentOrganizationOperation_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/Confluent/Confluent.Autorest/internal/ProxyCmdletDefinitions.ps1 b/generated/Confluent/Confluent.Autorest/internal/ProxyCmdletDefinitions.ps1 index e037c5796791..363fe2636e0f 100644 --- a/generated/Confluent/Confluent.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/generated/Confluent/Confluent.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -25,12 +25,12 @@ List all operations provided by Microsoft.Confluent. {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResult +Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResult .Link https://learn.microsoft.com/powershell/module/az.confluent/get-azconfluentorganizationoperation #> function Get-AzConfluentOrganizationOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301.IOperationResult])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOperationResult])] [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.Confluent.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.Confluent.private\Get-AzConfluentOrganizationOperation_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) @@ -179,7 +185,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -256,14 +261,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Delete = 'Az.Confluent.private\Remove-AzConfluentOrganization_Delete'; DeleteViaIdentity = 'Az.Confluent.private\Remove-AzConfluentOrganization_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -272,6 +278,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/Confluent/Confluent.Autorest/internal/Remove-AzConfluentOrganization.ps1 b/generated/Confluent/Confluent.Autorest/internal/Remove-AzConfluentOrganization.ps1 index af4671f4cfc3..706c500e9f7c 100644 --- a/generated/Confluent/Confluent.Autorest/internal/Remove-AzConfluentOrganization.ps1 +++ b/generated/Confluent/Confluent.Autorest/internal/Remove-AzConfluentOrganization.ps1 @@ -69,7 +69,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IConfluentIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -146,14 +145,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Delete = 'Az.Confluent.private\Remove-AzConfluentOrganization_Delete'; DeleteViaIdentity = 'Az.Confluent.private\Remove-AzConfluentOrganization_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -162,6 +162,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/Confluent/Confluent.Autorest/resources/README.md b/generated/Confluent/Confluent.Autorest/resources/README.md new file mode 100644 index 000000000000..937f07f8fec2 --- /dev/null +++ b/generated/Confluent/Confluent.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/Confluent/Confluent.Autorest/test-module.ps1 b/generated/Confluent/Confluent.Autorest/test-module.ps1 index cc52bc2f6733..df1f3b7d0ebf 100644 --- a/generated/Confluent/Confluent.Autorest/test-module.ps1 +++ b/generated/Confluent/Confluent.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-------------'